Uh oh!
There was an error while loading. Please reload this page.
test_runner: fix test runner concurrency - #47675
Conversation
MoLow
commented
Apr 22, 2023
CC @nodejs/performance Who can help me with creating a benchmark? I never have before |
tniessen
commented
Apr 22, 2023
Is this the relevant invocation? node/lib/internal/test_runner/runner.js Lines 390 to 397 in 0c5f253
If it is expected that test files are executed in parallel, then that should be covered by a test before any benchmark. Benchmarks are good for performance comparisons, but this is about a difference between design and implementation, i.e., functional correctness. |
MoLow
commented
Apr 22, 2023
yes
I will add a test |
tniessen
commented
Apr 22, 2023
@aduh95 In #45175, was the main motivation behind |
tniessen
left a comment
There was a problem hiding this comment.
Is the number of concurrent tests guaranteed to be at least two? I thought it depended on os.availableParallelism(), in which case it looks like this test might fail when only one or two CPU cores are assigned to the process group.
MoLow
commented
Apr 22, 2023
this fix introduced a race condition in tests outputs being reported out of order, so I fixed that as well |
There was a problem hiding this comment.
I think it makes sense. I think you could verify by replacing the use of os.availableParallelism() in the test runner code with 1 or 2 and seeing if the test hangs.
nodejs-github-bot
commented
Apr 23, 2023
e1dbbd2 to
bbc6eafCompareMoLow
commented
Apr 24, 2023
MoLow
commented
Apr 24, 2023
@benjamingr@mcollina PTAL |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The logic in this function (and even the function signature) seems like it should be part of #handleReportItem(). Is it possible to handle this there?
There was a problem hiding this comment.
handleReportItem happens only in order of reporting (using this.isClearToSend()), however, #skipReporting returns wrong values if it is called after the child process has completed but the test has not yet been reported
bbc6eaf to
17e3338Comparenodejs-github-bot
commented
Apr 24, 2023
MoLow
commented
Apr 24, 2023
nodejs-github-bot
commented
Apr 24, 2023
Landed in 8becacb...dccd25e |
PR-URL: nodejs#47675Fixes: nodejs#47365Fixes: nodejs#47696 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#47675Fixes: nodejs#47365Fixes: nodejs#47696 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fixes: #47365
Fixes: #47696
SafePromiseAllSettledReturnVoidruns sequentially before this fix :(this makes me wonder if we should add a benchmark for the test runner