You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
investigate flaky test-child-process-exec-abortcontroller-promisified on Windows CI #37568
I'd be happy to replace the timeout command with anything long-running. The test needs something long-running enough to give the node process time to kill it. The above suggests using ping -n 10 127.0.0.1 >NUL (for a 10 second pause). Another option on Windows would be executing a node process with the "never-ending" js fixture. Originally, that was how I wanted to write the test but it doesn't work on Linux (as killing the cp that's created with exec on linux doesn't kill the underlying Node process because of the shell, but on windows it works as expected).
Have you seen any issues with the sleep command, which is what I used on Linux?
Could we use node -e 'setTimeout(()=>{}, 9999)'? It should be cross plateform.
Or even node -e 'setInterval(()=>{}, 9999)'? (The overall test timeout is handled by tools/test.py so we can rely on that for platform-specific timeouts automatically.)
Could we use node -e 'setTimeout(()=>{}, 9999)'? It should be cross plateform.
Yes, but it needs something with a low enough timeout, so that it would die close enough to the end of the test but also high enough so that it would 100% get killed by the node process (test) before the timeout is up. The issue is that at the end of the tests, the tests use ps awwx to check if there's a node process that's still running.
@Trott setInterval didn't work for me, that was my original solution - before relying on TIMEOUT/sleep. see #37518
Activity
Trott commentedon Mar 2, 2021
This seems likely to have been introduced by #37325. @Linkgoron @benjamingr
Trott commentedon Mar 2, 2021
@nodejs/testing @nodejs/platform-windows @nodejs/child_process
Linkgoron commentedon Mar 2, 2021
Yes, this is obviously my added test. Looks an issue with background timeout:
https://www.ibm.com/support/pages/timeout-command-run-batch-job-exits-immediately-and-returns-error-input-redirection-not-supported-exiting-process-immediately
I'd be happy to replace the timeout command with anything long-running. The test needs something long-running enough to give the node process time to kill it. The above suggests using
ping -n 10 127.0.0.1 >NUL(for a 10 second pause). Another option on Windows would be executing a node process with the "never-ending"jsfixture. Originally, that was how I wanted to write the test but it doesn't work on Linux (as killing thecpthat's created with exec on linux doesn't kill the underlying Node process because of the shell, but on windows it works as expected).Have you seen any issues with the
sleepcommand, which is what I used on Linux?aduh95 commentedon Mar 2, 2021
Could we use
node -e 'setTimeout(()=>{}, 9999)'? It shouldbe cross platformwork on Windows.Trott commentedon Mar 2, 2021
Or even
node -e 'setInterval(()=>{}, 9999)'? (The overall test timeout is handled bytools/test.pyso we can rely on that for platform-specific timeouts automatically.)Linkgoron commentedon Mar 2, 2021
Yes, but it needs something with a low enough timeout, so that it would die close enough to the end of the test but also high enough so that it would 100% get killed by the node process (test) before the timeout is up. The issue is that at the end of the tests, the tests use
ps awwxto check if there's a node process that's still running.@Trott setInterval didn't work for me, that was my original solution - before relying on TIMEOUT/sleep. see #37518
Linkgoron commentedon Mar 2, 2021
On Windows, even setInterval would work
aduh95 commentedon Mar 2, 2021
A potential fix would be to keep using
sleepon linux, and usesetIntervaleverywhere else, right?Linkgoron commentedon Mar 2, 2021
I'm not sure why we would change everything if the issue is only on windows, but your fix should work.
test: fix flaky test-child-process-exec-abortcontroller-promisified
test: fix flaky test-child-process-exec-abortcontroller-promisified
test: fix flaky test-child-process-exec-abortcontroller-promisified
test: fix flaky test-child-process-exec-abortcontroller-promisified