Skip to content

Commit 9fc9534

Browse files
kvakildanielleadams
authored andcommitted
test: tune down parallelism for some flaky tests
These tests seem to timeout quite often. I don't know why, but one possible reason is that they are starting a lot of threads. It seems that tests in `test/parallel` are assumed to only start one thread each, so having 11 threads running at a time feels like a lot. It also seems that these tests fail in a correlated fashion: take a look at [this reliability report][]. The failures all occur on the same build machines on the same PRs. This suggests to me some sort of CPU contention. [this reliability report]: nodejs/reliability#334 On my Linux machine decreasing the parallelism & iterations here reduce the `user` time from ~11.5 seconds to ~2 seconds, depending on the test. I have seen these tests take 30-60 seconds on CI (Alpine in particular). I went back to the diffs that introduced that introduced these changes and verified that they failed at least 90% of the time with the reduced iteration count, which feels sufficient. Refs: #43499 Refs: #43084 PR-URL: #44090 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 646417c commit 9fc9534

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

test/parallel/test-worker-fshandles-error-on-termination.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const fs = require('fs/promises');
66
const { scheduler } = require('timers/promises');
77
const { parentPort, Worker } = require('worker_threads');
88

9-
const MAX_ITERATIONS = 20;
10-
const MAX_THREADS = 10;
9+
const MAX_ITERATIONS = 5;
10+
const MAX_THREADS = 6;
1111

1212
// Do not use isMainThread so that this test itself can be run inside a Worker.
1313
if (!process.env.HAS_STARTED_WORKER) {

test/parallel/test-worker-fshandles-open-close-on-termination.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const fs = require('fs/promises');
66
const { scheduler } = require('timers/promises');
77
const { parentPort, Worker } = require('worker_threads');
88

9-
const MAX_ITERATIONS = 20;
10-
const MAX_THREADS = 10;
9+
const MAX_ITERATIONS = 5;
10+
const MAX_THREADS = 6;
1111

1212
// Do not use isMainThread so that this test itself can be run inside a Worker.
1313
if (!process.env.HAS_STARTED_WORKER) {

test/parallel/test-worker-http2-stream-terminate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const { Worker, parentPort } = require('worker_threads');
1111
// stream activity is ongoing, in particular the C++ function
1212
// ReportWritesToJSStreamListener::OnStreamAfterReqFinished.
1313

14-
const MAX_ITERATIONS = 20;
15-
const MAX_THREADS = 10;
14+
const MAX_ITERATIONS = 5;
15+
const MAX_THREADS = 6;
1616

1717
// Do not use isMainThread so that this test itself can be run inside a Worker.
1818
if (!process.env.HAS_STARTED_WORKER) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy