Commit Graph

11 Commits

Author SHA1 Message Date
Joyee Cheung
dac5f29691
test: skip test-child-process-stdio-reuse-readable-stdio on Windows
It is flaky due to the same cause of test-child-process-pipe-dataflow
being flaky - cygwin quirks - so skip it on Windows too.

Drive-by: remove the skip mark of test-child-process-pipe-dataflow
in the status file and directly skip it in the test with a comment.

PR-URL: https://github.com/nodejs/node/pull/49621
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-09-14 21:23:46 +00:00
Livia Medeiros
e738edce6a
test: use tmpdir.resolve()
Subsystems: blob, child_process, common, crypto, http, http2,
readline, repl, snapshot, trace_events

PR-URL: https://github.com/nodejs/node/pull/49127
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-08-15 13:45:34 +00:00
Luigi Pinca
0c2011c6c5 test: deflake child-process-pipe-dataflow
Fixes: https://github.com/nodejs/node/issues/25988

PR-URL: https://github.com/nodejs/node/pull/40838
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-11-17 19:32:22 -08:00
Rich Trott
7f54dd4f07 test: improve error reporting in test-child-process-pipe-dataflow
When the test fails, it usually ends up failing on the assertion that
`wc` did not find as many bytes as it expected. That may not be
helpful if it is caused by a failure earlier in the command
pipeline ( cat | grep | wc ). Move the byte check to
`process.on('exit')` so that other error handlers that report the
existence of errors run first.

Refs: https://github.com/nodejs/node/issues/25988

PR-URL: https://github.com/nodejs/node/pull/37632
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-03-08 21:38:40 -08:00
Santiago Gimeno
ca8eb795be test: fix child-process-pipe-dataflow
Make sure all the `wc` process stdout data is received before checking
its validity.

Fixes: https://github.com/nodejs/node/issues/25988

PR-URL: https://github.com/nodejs/node/pull/36366
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-08 05:23:36 +00:00
Harshitha KP
4fedb702b2
test: use portable EOL
The test wanted to cut huge string into 1KB strings,
for which a new line character was inserted at appropriate
places. The value is different in Windows (10, 13).
Make it portable, by making use of os.EOL semantics

Refs: https://github.com/nodejs/node/issues/25988

PR-URL: https://github.com/nodejs/node/pull/32104
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-13 10:51:54 +01:00
Rich Trott
b29986040e test: increase debugging information in subprocess test
Refs: https://github.com/nodejs/node/issues/25988#issuecomment-560394046

PR-URL: https://github.com/nodejs/node/pull/30761
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-12-04 05:36:49 -08:00
Rich Trott
cb16872416 test: increase debugging information on failure
Increase the information displayed when
test-child-process-pipe-dataflow.js fails.

PR-URL: https://github.com/nodejs/node/pull/27790
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-05-23 07:53:57 -07:00
Anna Henningsen
cc7b3fbaab child_process: only stop readable side of stream passed to proc
Closing the underlying resource completely has the unwanted side effect
that the stream can no longer be used at all, including passing it
to other child processes.

What we want to avoid is accidentally reading from the stream;
accordingly, it should be sufficient to stop its readable side
manually, and otherwise leave the underlying resource intact.

Fixes: https://github.com/nodejs/node/issues/27097
Refs: https://github.com/nodejs/node/pull/21209

PR-URL: https://github.com/nodejs/node/pull/27373
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-04-29 20:01:27 +05:30
Gireesh Punathil
448b0c0afc test: capture stderr from child processes
If the test fails with errors from the child commands,
there is no debug info. Suppliment the stderr data
so that we know what to look for.

Refs: https://github.com/nodejs/node/issues/25988
PR-URL: https://github.com/nodejs/node/pull/26007
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-11 09:33:58 +05:30
Gireesh Punathil
b1f82e4342 child_process: close pipe ends that are re-piped
when t0 and t1 are spawned with t0's outputstream [1, 2] is piped into
t1's input, a new pipe is created which uses a copy of the t0's fd.
This leaves the original copy in Node parent, unattended. Net result is
that when t0 produces data, it gets bifurcated into both the copies

Detect the passed handle to be of 'wrap' type and close after the
native spawn invocation by which time piping would have been over.

Fixes: https://github.com/nodejs/node/issues/9413
Fixes: https://github.com/nodejs/node/issues/18016

PR-URL: https://github.com/nodejs/node/pull/21209
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-06 17:50:46 +05:30