-
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 test-worker-prof #37372
Conversation
79cb50a
to
311bfc1
Compare
311bfc1
to
1de4b38
Compare
I removed the |
Stress test on Windows for this PR: https://ci.nodejs.org/job/node-stress-single-test/212/ Stress test on Raspberry Pi for this PR: https://ci.nodejs.org/view/Stress/job/node-stress-single-test-pi1-fanned/136/ |
Stress test show it happening less but still happening. I'm going to move this to draft while I investigate more. |
Extending the timeout is the wrong solution. It's not that the test needs more time. It's that there is a race condition so the child process never exits. |
@Trott - from my earlier observation (I will soon search and find out where and what it was), I guess it was to do with CPU starvation on systems with very less CPU:
Do you know how many CPUs the failing system has? I think node/test/sequential/test-worker-prof.js Line 29 in 1de4b38
process.execPath to __filename ? WDYT?
|
ok, these are the relevant comments where I had observations on the CPU starvation patterns: |
Let's try changing |
1de4b38
to
d8596e7
Compare
Stress test with this PR: https://ci.nodejs.org/job/node-stress-single-test/215/ |
Test failed on macOS in CI because there were only 8 ticks rather than more than 15. // Test that at least 15 ticks have been recorded for both parent and child
// threads. When not tracking Worker threads, only 1 or 2 ticks would
// have been recorded.
// When running locally on x64 Linux, this number is usually at least 200
// for both threads, so 15 seems like a very safe threshold.
assert(ticks >= 15, `${ticks} >= 15`); |
ok, so this time it was too |
On my local machine, there was no noticeable difference in ticks between n=10 and n=100. But up around n=1000, we start to see a ticks go from around 80 to around 200. So, trying n=1024.... |
This comment has been minimized.
This comment has been minimized.
Stress test: https://ci.nodejs.org/job/node-stress-single-test/216/ ✅ |
b690898
to
4a0751a
Compare
Fixes: nodejs#26401 Co-authored-by: Gireesh Punathil <[email protected]> PR-URL: nodejs#37372 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
4a0751a
to
04fb597
Compare
Landed in 04fb597 |
Fixes: #26401 Co-authored-by: Gireesh Punathil <[email protected]> PR-URL: #37372 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
It's probably flaky on node 12.21.0 too: |
Fixes: #26401