Skip to content

Commit 7779fab

Browse files
committed
fixup! test: make test-worker-prof more robust
1 parent d966328 commit 7779fab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/sequential/test-worker-prof.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if (process.argv[2] === 'child') {
1818

1919
const { Worker } = require('worker_threads');
2020
const w = new Worker(fixtures.path('workload', 'spin.js'), {
21-
env: { NODE_TEST_SPIN_MS: 100 }
21+
env: { NODE_TEST_SPIN_MS: 1000 }
2222
});
2323

2424
w.on('exit', common.mustCall(() => {
@@ -58,8 +58,8 @@ if (process.argv[2] === 'child') {
5858
console.log('parent ticks', parentTicks.length);
5959
// When not tracking Worker threads, only 1 or 2 ticks would
6060
// have been recorded.
61-
// prof_sampling_interval is by default 1 millsecond, so spinning for 100
62-
// milliseconds should result in ~100 ticks.
61+
// prof_sampling_interval is by default 1 millsecond. A higher NODE_TEST_SPIN_MS
62+
// should result in more ticks, while 15 should be safe on most machines.
6363
assert(workerTicks.length > 15, `worker ticks <= 15:\n${workerTicks.join('\n')}`);
6464
assert(parentTicks.length > 15, `parent ticks <= 15:\n${parentTicks.join('\n')}`);
6565
}

0 commit comments

Comments
 (0)