-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix flaky child-process-exec-kill-throws #12111
Conversation
Stress test on master which should show failures: https://ci.nodejs.org/job/node-stress-single-test/1147/nodes=win-vs2015/console |
Stress test on this PR (should show no failures): https://ci.nodejs.org/job/node-stress-single-test/1148/nodes=win-vs2015/console |
If the CI and stress tests come up as expected, I would propose that we land this sooner than the 48 hours we normally wait. (I won't argue, though, if someone feels it should wait.) |
@nodejs/testing |
Hmmm, CI is not looking good. Looks like it might be failing because something (maybe this test somehow) is leaving around leftover child processes? Will have to look more closely... |
Confirmed that now that the initial bug in the test is fixed, it now does not reliably terminate the child process. :-| |
(On the upside, the stress tests are looking good.) |
Adding a listener for the |
sigh Nope, that didn't fix the "child process not actually terminating" issue... |
I think the problem here is that killing the child process will only kill the shell process that executes the nodejs child process leaving the child process orphan and alive. TBH I don't know how |
If @santigimeno is right, then try using |
Possibly, but this isn't Windows-specific. The bug in the test that this fixes was Windows specific. The new issue it exposes now that bug is fixed.. that's on all sorts of platforms. Check the CI results. |
(In fact, the current not-cleaning-up-after-itself issue doesn't affect the Windows runs on the last CI, so it may not affect Windows at all!) |
This is a fix for test-child-process-exec-kill-throws which is currently flaky on Windows. A bug in the test was causing the child process to fail for reasons other than those intended by the test. Instead of failing for exceeding the `maxBuffer` setting, the test was failing because it was trying to load `internal/child_process` without being passed the `expose-internals` flag. Move that module to where only the parent process (which gets the flag) loads it. Additionally, improve an assertion message to help debug problems like this. Fixes: nodejs#12053
Unfortunately, I don't think changing to I don't think we need a process that runs forever. We just need a process that errors out. So I'm removing the |
This looks much better! And it still exercises the relevant code. Some Linux hosts in CI are struggling right now, but that's not related to this. I might run another CI again once that is cleared up, just to be cautious. |
(Also: I'm super-pleased that the Makefile changes from a few weeks ago caught a test that sometimes leaves stray processes around. Hooray!) |
Oh, right, need to do a Windows stress test too: https://ci.nodejs.org/job/node-stress-single-test/1149/nodes=win-vs2015/console |
CI is clean except for one unrelated build failure. Stress test is still running, but looks great so far (1200 successes and 0 failures so far). |
This is a fix for test-child-process-exec-kill-throws which is currently flaky on Windows. A bug in the test was causing the child process to fail for reasons other than those intended by the test. Instead of failing for exceeding the `maxBuffer` setting, the test was failing because it was trying to load `internal/child_process` without being passed the `expose-internals` flag. Move that module to where only the parent process (which gets the flag) loads it. Additionally, improve an assertion message to help debug problems like this. PR-URL: nodejs#12111 Fixes: nodejs#12053 Reviewed-By: Richard Lau <[email protected]>
Landed in a10e657 |
This is a fix for test-child-process-exec-kill-throws which is currently flaky on Windows. A bug in the test was causing the child process to fail for reasons other than those intended by the test. Instead of failing for exceeding the `maxBuffer` setting, the test was failing because it was trying to load `internal/child_process` without being passed the `expose-internals` flag. Move that module to where only the parent process (which gets the flag) loads it. Additionally, improve an assertion message to help debug problems like this. PR-URL: nodejs#12111 Fixes: nodejs#12053 Reviewed-By: Richard Lau <[email protected]>
This is a fix for test-child-process-exec-kill-throws which is currently
flaky on Windows.
A bug in the test was causing the child process to fail for reasons
other than those intended by the test. Instead of failing for exceeding
the
maxBuffer
setting, the test was failing because it was trying toload
internal/child_process
without being passed theexpose-internals
flag. Move that module to where only the parentprocess (which gets the flag) loads it.
Additionally, improve an assertion message to help debug problems like
this.
Fixes: #12053
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test child_process