aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-child-process-flush-stdio.js
AgeCommit message (Collapse)Author
2018-10-15test: modernize test-child-process-flush-stdioViacheslav Liakhov
PR-URL: https://github.com/nodejs/node/pull/23504 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2016-07-21test: make import common as the first lineSakthipriyan Vairamani
The `test/common` module has the capability to identify if any variable is leaked to the global scope and fail the test. So that has to be imported at the beginning. PR-URL: https://github.com/nodejs/node/pull/7786 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-06-07test: fix spawn on windowsBrian White
Most Windows systems do not have an external `echo` program installed, so any attempts to spawn `echo` as a child process will fail with `ENOENT`. This commit forces the use of the built-in `echo` provided by `cmd.exe`. PR-URL: https://github.com/nodejs/node/pull/7049 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-02-11child_process: fix data loss with readable eventBrian White
This commit prevents child process stdio streams from being automatically flushed on child process exit/close if a 'readable' event handler has been attached at the time of exit. Without this, child process stdio data can be lost if the process exits quickly and a `read()` (e.g. from a 'readable' handler) hasn't had the chance to get called yet. Fixes: https://github.com/nodejs/node/issues/5034 PR-URL: https://github.com/nodejs/node/pull/5036 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-01child_process: flush consuming streamsDave
When a client calls read() with a nonzero argument on a Socket, that Socket sets this._consuming to true. It never sets this._consuming back to false. ChildProcess.flushStdio() currently doesn't flush any streams where _consuming is truthy. But, that means that it never flushes any stream that has ever been read from. This prevents a child process from ever closing if one of its streams has been read from, causing issue #4049. This commit allows consuming streams to be flushed, and the child process to emit a close event. Fixes: https://github.com/nodejs/node/issues/4049 PR-URL: https://github.com/nodejs/node/pull/4071 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>