aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-http-set-timeout-server.js
AgeCommit message (Collapse)Author
2019-02-28benchmark,doc,lib,test: capitalize commentsRuben Bridgewater
This updates a lot of comments. PR-URL: https://github.com/nodejs/node/pull/26223 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2017-07-25test: fix flaky http(s)-set-server-timeout testsRich Trott
The tests include a callback that might not be invoked but is wrapped in common.mustCall(). Remove the common.mustCall() wrapper and add a comment explaining that it should not be added. Add a new test case that sets the timeout to 1ms and waits for both the connection handler and the timeout handler to be invoked. This version keeps the common.mustCall() wrapper intact around the connection handler (although it's mostly semantic and not necessary for the test as the test will certainly fail or time out if that handler isn't invoked). PR-URL: https://github.com/nodejs/node/pull/14380 Fixes: https://github.com/nodejs/node/issues/11768 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-11test: fix flaky test-https-set-timeout-serverRich Trott
Because of a race condition, connection listener may not be invoked if test is run under load. Remove `common.mustCall()` wrapper from the listener. Move the test to `parallel` because it now works under load. Make similar change to http test to keep them in synch even though it is much harder to trigger the race in http. PR-URL: https://github.com/nodejs/node/pull/14134 Fixes: https://github.com/nodejs/node/issues/14133 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-03test: refactor test-http(s)-set-timeout-serverAlexey Orlenko
* Make changes to `test-https-set-timeout-server` to resolve inconsistencies with its http counterpart: - Apply the changes analogous to those in GH-13802 to the https test. - Add a missing `common.mustCall()` wrapper. - Make small stylistic changes (e.g., remove unnecessary line breaks in comments) to make it visually consistent with the http test. * Use arrow functions. PR-URL: https://github.com/nodejs/node/pull/13935 Fixes: https://github.com/nodejs/node/issues/13588 Refs: https://github.com/nodejs/node/pull/13802 Refs: https://github.com/nodejs/node/pull/13625 Refs: https://github.com/nodejs/node/pull/13822 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-26test: make http(s)-set-timeout-server more similarJulien Klepatch
Make test-http(s)-set-timeout-server tests more similar and resolve the following issues: * `test-https-set-timeout-server.js` was missing some `assert` statements, including with `http` module * Both files were missing some calls to `common.mustCall()` * Both files were calling `createServer()` in different ways PR-URL: https://github.com/nodejs/node/pull/13822 Refs: https://github.com/nodejs/node/issues/13588 Refs: https://github.com/nodejs/node/pull/13625 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-23test: refactor test-http-set-timeout-serverRich Trott
* Use `common.mustCall()` to track callback invocations * Remove console.log() statements unrelated to the test * Add blank line to conform with test-writing guide PR-URL: https://github.com/nodejs/node/pull/13802 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-06-19test: make test-http(s)-set-timeout-server alikejklepatch
Make test-http(s)-set-timeout-server tests more similar and resolve the following issues: * `test-http-set-timeout-server.js` had a `secReceived` check in `serverResponseTimeoutWithPipeline()` that was added to prevent flakiness, but this did not exist in the https counterpart. * `test-https-set-timeout-server.js` utilized `common.mustCall()`, `common.mustNotCall()`, etc., while the http counterpart utilized the old method of checking flags on exit of the process. Refs: https://github.com/nodejs/node/issues/13588 PR-URL: https://github.com/nodejs/node/pull/13625 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-03-26test: add common.noop, default for common.mustCall()James M Snell
Export a new common.noop no-operation function for general use. Allow using common.mustCall() without a fn argument to simplify test cases. Replace various non-op functions throughout tests with common.noop PR-URL: https://github.com/nodejs/node/pull/12027 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-14test: fix flaky test-http-set-timeout-serverSantiago Gimeno
It can happen that the connection and server is closed before the second reponse has been processed by server. In this case, the `res.setTimeout()` callback will never be called causing the test to fail. Fix this by only closing the connection and server when the 2nd has been received. PR-URL: https://github.com/nodejs/node/pull/11790 Fixes: https://github.com/nodejs/node/issues/11768 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-03-10meta: restore original copyright headerJames M Snell
A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
2017-01-11test: s/assert.equal/assert.strictEqual/Gibson Fahnestock
Use assert.strictEqual instead of assert.equal in tests, manually convert types where necessary. PR-URL: https://github.com/nodejs/node/pull/10698 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
2017-01-11test: use eslint to fix var->const/letGibson Fahnestock
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-02test: use const for all require() callscjihrig
PR-URL: https://github.com/nodejs/node/pull/10550 Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-04-19test: fix flaky test-http-set-timeout-serverSantiago Gimeno
Make the servers listen on a free port number picked by the OS to avoid rare `EADDRINUSE` errors on `SmartOS`. Fixes: https://github.com/nodejs/node/issues/6197 PR-URL: https://github.com/nodejs/node/pull/6248 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2015-05-19test: enable linting for testsRoman Reiss
Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-05-16http,net,tls: return this from setTimeout methodsEvan Lucas
Modifies the setTimeout methods for the following prototypes: - http.ClientRequest - http.IncomingMessage - http.OutgoingMessage - http.Server - https.Server - net.Socket - tls.TLSSocket Previously, the above functions returned undefined. They now return `this`. This is useful for chaining function calls. PR-URL: https://github.com/nodejs/io.js/pull/1699 Reviewed-By: Roman Reiss <me@silverwind.io>
2015-02-22test: common.js -> commonBrendan Ashworth
This commit changes many test styles to change all references from require('./common.js'); to require('./common');. The latter is much more common, with the former only being used in 50 tests. It is just a stylistic change, and it seems that `common.js` was introduced by a rogue test and copied and pasted into the rest. Semver: patch PR-URL: https://github.com/iojs/io.js/pull/917 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-12Remove excessive copyright/license boilerplateisaacs
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
2014-12-17test: split test in parallel/sequentialFedor Indutny
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/iojs/io.js/pull/172 Fix: iojs/io.js#139