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-timeout on Linux #20414
assert.js:77 throw new AssertionError(obj); ^AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B:+ expected - actual- 'SIGSEGV'+ 'SIGTERM' at cp.exec.common.mustCall (/data/iojs/build/workspace/node-test-commit-linuxone/nodes/rhel72-s390x/test/parallel/test-child-process-exec-timeout.js:34:12) at /data/iojs/build/workspace/node-test-commit-linuxone/nodes/rhel72-s390x/test/common/index.js:474:15 at ChildProcess.exithandler (child_process.js:289:5) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:957:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:246:5)
reviewing the type of failures and the test case, my opinion is that the test case logic is vulnerable for race conditions and arbitrary behaviors that are platform / load dependant.
As the child process exits immediately after writing to the console, and as the console writing is non-blocking, there is no guarentee that the data will be flushed to the stream, whatever tiny the data element is, even if the parent waits for a long time. ref: #19218
In summary, I believe there is nothing LinuxONE specific, and the reason rooted in the test case itself.
for 1 I propose the child to have a timer that is at least more than 1000 and the parent to maintain a timeout that is between 1000 and the child's timeout.
for 2 I propose to end the standard streams in the child before exiting in expectation of draining the buffered data.
ot ok 193 parallel/test-child-process-exec-timeout --- duration_ms: 0.336 severity: fail exitcode: 1 stack: |- assert.js:77 throw new AssertionError(obj); ^ AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B: + expected - actual - 'SIGSEGV' + 'SIGTERM' at cp.exec.common.mustCall (/home/iojs/build/workspace/node-test-commit-linux/nodes/fedora-last-latest-x64/test/parallel/test-child-process-exec-timeout.js:34:12) at /home/iojs/build/workspace/node-test-commit-linux/nodes/fedora-last-latest-x64/test/common/index.js:474:15 at ChildProcess.exithandler (child_process.js:289:5) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:957:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:246:5) ...
Will see if I can implement fixes for the issues identified by @gireeshpunathil unless he or someone else already has something in the works or even submitted.
changed the title [-]Investigate flaky test-child-process-exec-timeout on LInuxONE[/-][+]Investigate flaky test-child-process-exec-timeout on LInux[/+]on May 7, 2018
If it's not a bug, we should allow SIGSEGV in the test.
If it's a bug in libuv, we should mark the test as flaky (putting the flaky and not-flaky test cases, if any, in separate files) and leave a comment in parallel.status with the relevant issue in the libuv tracker (opening it if it doesn't already exist).
If it's a bug in Node.js, uh, let's fix it. :-D
If it's a bug in the test logic, let's fix that.
I propose the child to have a timer that is at least more than 1000 and the parent to maintain a timeout that is between 1000 and the child's timeout.
That may mitigate things, but I don't think it will fix it entirely because it's still dependent on timing in two independent processes. If we're going to go that route, we should definitely move this test to sequential so that the processes aren't competing with other tests for resources.
(The above reproduction doesn't happen every time. Like, not even close to every time. Although I certainly suspect that running 4 or 8 or 16 simultaneous instances would increase the reproducibility.)
As #11052 has revealed an unsafe singal stack issue, it explains one type of failure in this test: expected SIGTERM but got SIGSEGV so I would park my theories on the test case logic. The other type: expected child stdout but got ' ' is unrelated to this issue, and may require a rework.
changed the title [-]Investigate flaky test-child-process-exec-timeout on LInux[/-][+]Investigate flaky test-child-process-exec-timeout on Linux[/+]on Jun 3, 2018
Activity
Trott commentedon May 5, 2018
Again today: https://ci.nodejs.org/job/node-test-commit-linuxone/1000/nodes=rhel72-s390x/testReport/
@nodejs/testing @nodejs/build @nodejs/child_process
gireeshpunathil commentedon May 6, 2018
reviewing the type of failures and the test case, my opinion is that the test case logic is vulnerable for race conditions and arbitrary behaviors that are platform / load dependant.
The
killsignal may be delivered:execed into the new process (post fork phase)exitroutineWhich of this is going to happen will depend on:
As the child process exits immediately after writing to the console, and as the console writing is non-blocking, there is no guarentee that the data will be flushed to the stream, whatever tiny the data element is, even if the parent waits for a long time. ref: #19218
In summary, I believe there is nothing LinuxONE specific, and the reason rooted in the test case itself.
for 1 I propose the child to have a timer that is at least more than 1000 and the parent to maintain a timeout that is between 1000 and the child's timeout.
for 2 I propose to end the standard streams in the child before exiting in expectation of draining the buffered data.
Trott commentedon May 7, 2018
Another one today:
https://ci.nodejs.org/job/node-test-commit-linux/18540/nodes=fedora-last-latest-x64/consoleText
Will see if I can implement fixes for the issues identified by @gireeshpunathil unless he or someone else already has something in the works or even submitted.
[-]Investigate flaky test-child-process-exec-timeout on LInuxONE[/-][+]Investigate flaky test-child-process-exec-timeout on LInux[/+]Trott commentedon May 7, 2018
Is the fact that we can get SIGSEGV instead of SIGTERM from this code a bug or a fact of life? (If a bug, is it in this code or in Node.js/libuv?)
SIGSEGVin the test.parallel.statuswith the relevant issue in the libuv tracker (opening it if it doesn't already exist).That may mitigate things, but I don't think it will fix it entirely because it's still dependent on timing in two independent processes. If we're going to go that route, we should definitely move this test to
sequentialso that the processes aren't competing with other tests for resources.Trott commentedon May 7, 2018
Update: I was able to trivially cause the problem using the 15 lines of code in the previous comment on test-rackspace-fedora26-x64-1:
Bonus: The process hung there too. I had to end it with cntl-C.
Trott commentedon May 7, 2018
(The above reproduction doesn't happen every time. Like, not even close to every time. Although I certainly suspect that running 4 or 8 or 16 simultaneous instances would increase the reproducibility.)
Trott commentedon May 7, 2018
Update: Reproduces pretty reliably at 64 simultaneous instances.
Trott commentedon May 7, 2018
@nodejs/libuv
gireeshpunathil commentedon May 8, 2018
link this with #11052 as that has new findings.
gireeshpunathil commentedon May 8, 2018
As #11052 has revealed an unsafe singal stack issue, it explains one type of failure in this test: expected
SIGTERMbut gotSIGSEGVso I would park my theories on the test case logic. The other type: expectedchild stdoutbut got' 'is unrelated to this issue, and may require a rework.[-]Investigate flaky test-child-process-exec-timeout on LInux[/-][+]Investigate flaky test-child-process-exec-timeout on Linux[/+]