aboutsummaryrefslogtreecommitdiff
path: root/test/sequential/test-child-process-pass-fd.js
AgeCommit message (Collapse)Author
2017-12-12test: fix flaky test-child-process-pass-fdRich Trott
test-child-process-pass-fd needs to launch many processes simultaneously. On Fedora 24, this can result in EAGAIN "Resource temporarily unavailable" errors. When this occurs, simply try to launch a worker again. PR-URL: https://github.com/nodejs/node/pull/17598 Fixes: https://github.com/nodejs/node/issues/17589 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-12-11test: refactor test-child-process-pass-fdRich Trott
Add a comment explaining the test (especailly why it forks 80 processes. Use destructuring and an arrow function callback. PR-URL: https://github.com/nodejs/node/pull/17596 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2017-07-04test: simplify test skippingVse Mozhet Byt
* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-23test: check number of message eventsRich Trott
When a no-op message event handler is used in a test, make it clear what is expected by using `common.mustCall()` and `common.mustNotCall()`. PR-URL: https://github.com/nodejs/node/pull/13125 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <mhdawson@ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@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>
2016-10-27test: prevent workers outliving parentSam Roberts
test-child-process-pass-fd.js parent can exit with an error on failure to fork, in which case it will leak child processes. Limit child lifetime to that of parent. Fixes: https://github.com/nodejs/node/issues/9255 PR-URL: https://github.com/nodejs/node/pull/9257 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-22test: fix flaky `test-child-process-pass-fd`Santiago Gimeno
Listen on random ports instead of using `common.PORT`. Fixes: https://github.com/nodejs/node/issues/8209 PR-URL: https://github.com/nodejs/node/pull/8212 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
2016-08-20child_process: workaround fd passing issue on OS XSantiago Gimeno
There's an issue on some `OS X` versions when passing fd's between processes. When the handle associated to a specific file descriptor is closed by the sender process before it's received in the destination, the handle is indeed closed while it should remain opened. In order to fix this behaviour, don't close the handle until the `NODE_HANDLE_ACK` is received by the sender. Added `test-child-process-pass-fd` that is basically `test-cluster-net-send` but creating lots of workers, so the issue reproduces on `OS X` consistently. Fixes: https://github.com/nodejs/node/issues/7512 PR-URL: https://github.com/nodejs/node/pull/7572 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>