-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
test: account for truthy signal in flaky async_hooks tests #58478
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: account for truthy signal in flaky async_hooks tests #58478
Conversation
When the spawned child process gets closed with a signal, the exit code is not set and that is why the exit code assertion was failing. This change adjusts the test to check the signal and if it is truthy, it doesn't assert the exit code and instead logs the signal and continues the rest of the assertions. Refs: nodejs#58463 (comment) Refs: nodejs#58199 Refs: nodejs#58463 Signed-off-by: Darshan Sen <raisinten@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58478 +/- ##
==========================================
+ Coverage 90.19% 90.20% +0.01%
==========================================
Files 635 635
Lines 187255 187344 +89
Branches 36775 36796 +21
==========================================
+ Hits 168896 169003 +107
+ Misses 11137 11098 -39
- Partials 7222 7243 +21 🚀 New features to boost your workflow:
|
Landed in 7ce82ad |
When the spawned child process gets closed with a signal, the exit code is not set and that is why the exit code assertion was failing. This change adjusts the test to check the signal and if it is truthy, it doesn't assert the exit code and instead logs the signal and continues the rest of the assertions. Refs: #58463 (comment) Refs: #58199 Refs: #58463 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #58478 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
child.on('close', common.mustCall((code) => { | ||
assert.strictEqual(code, 1); | ||
child.on('close', common.mustCall((code, signal) => { | ||
if (signal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed this PR from #58567 and it seems to me this is more sweeping the issue under the rug, because the test should not really expect a signal to appear as it does not actively kill the child process. If the child process is killed by a signal, something is going wrong, and the changes here would be masking it. If it's just AIX machine weirdness the right workaround should probably be branching on AIX and ignore if the signal is from a known set (but SIGSEGV, etc. shouldn't be expected in any case, otherwise if someone breaks the path by introducing a memory corruption etc. the test would ignore it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we revert this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flaky test report #58199 of another test which is very similar to this one shows that this can happen on Linux x64 too. The failure in #58122 (comment) on 6 May, according to Jenkins, is the only place where I have seen it fail on Linux x64. I checked a couple of failures before and after that one in the sequence of Jenkins CI runs on that machine and I wasn't able to find more occurrences. The only ones that happened more frequently and got recorded in the reliability repo are the AIX failures from 20 to 28 May recently and the ancient ones from 2023.
In #58463 (comment), @Flarna suggested that this might be caused by a resource limitation.
A complete revert would reintroduce the flake whereas this could still be improved. Sent a PR: #58601.
This change skips asserting the exit code of the child process with the corrupted async hooks stack only on those platforms where termination via a signal has been observed. Refs: nodejs#58478 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com>
This change skips asserting the exit code of the child process with the corrupted async hooks stack only on those platforms where termination via a signal has been observed. Refs: #58478 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #58601 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This change skips asserting the exit code of the child process with the corrupted async hooks stack only on those platforms where termination via a signal has been observed. Refs: #58478 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #58601 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
When the spawned child process gets closed with a signal, the exit code is not set and that is why the exit code assertion was failing. This change adjusts the test to check the signal and if it is truthy, it doesn't assert the exit code and instead logs the signal and continues the rest of the assertions. Refs: #58463 (comment) Refs: #58199 Refs: #58463 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #58478 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This change skips asserting the exit code of the child process with the corrupted async hooks stack only on those platforms where termination via a signal has been observed. Refs: #58478 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #58601 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
When the spawned child process gets closed with a signal, the exit code is not set and that is why the exit code assertion was failing. This change adjusts the test to check the signal and if it is truthy, it doesn't assert the exit code and instead logs the signal and continues the rest of the assertions.
Refs: #58463 (comment)
Refs: #58199
Refs: #58463