Skip to content

Commit f7a0dbb

Browse files
committed
test: parallelize test-without-async-context-frame correctly
It previously re-einvented the pattern matching that's already supported by test.py, and was running the tests one by one, which can lead to time out on slower machines. This move it to sequential and use wildcard support in test.py to correctly parallelize the tests.
1 parent 1d2b89a commit f7a0dbb

File tree

2 files changed

+24
-64
lines changed

2 files changed

+24
-64
lines changed

test/parallel/test-without-async-context-frame.mjs

Lines changed: 0 additions & 64 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { isWindows } from '../common/index.mjs';
2+
import { spawn } from 'node:child_process';
3+
import { once } from 'node:events';
4+
import { fileURLToPath } from 'node:url';
5+
import { strictEqual } from 'node:assert';
6+
7+
const python = process.env.PYTHON || (isWindows ? 'python' : 'python3');
8+
9+
const testRunner = fileURLToPath(
10+
new URL('../../tools/test.py', import.meta.url)
11+
);
12+
13+
const proc = spawn(python, [
14+
testRunner,
15+
`--mode=${process.features.debug ? 'debug' : 'release'}`,
16+
`--shell=${process.execPath}`,
17+
'--node-args=--no-async-context-frame',
18+
'*/test-async-local-storage-*',
19+
], {
20+
stdio: ['inherit', 'inherit', 'inherit'],
21+
});
22+
23+
const [code] = await once(proc, 'exit');
24+
strictEqual(code, 0);

0 commit comments

Comments
 (0)