Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test_runner: fix concurrent test
  • Loading branch information
rluvaton committed Jun 28, 2023
commit 1d68c63602061d37fe916db2bab7a444d8b19c29
3 changes: 2 additions & 1 deletion lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const {
StringPrototypeStartsWith,
TypedArrayPrototypeGetLength,
TypedArrayPrototypeSubarray,
NumberMAX_SAFE_INTEGER
} = primordials;

const { spawn } = require('child_process');
Expand Down Expand Up @@ -481,7 +482,7 @@ function run(options) {

if (isNodeStream(testFiles)) {
return testFiles
.map(runSingleFile, { __proto__: null, signal, concurrency })
.map(runSingleFile, { __proto__: null, signal, concurrency: NumberMAX_SAFE_INTEGER })

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used this concurrency to not wait for tests otherwise tests that not finish not allow us to run other tests, and this is also to keep the behavior of AllSettled...

will be changed to Infinity once the below PR is merged:

.toArray();
}

Expand Down
3 changes: 0 additions & 3 deletions test/parallel/test-runner-concurrency.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ describe('concurrency: true implies Infinity', { concurrency: true }, () => {
}

test('--test multiple files', { skip: os.availableParallelism() < 3 }, async () => {

// TODO - fix this test, it failed due to concurrency not being set you
// waiting for first to finish before starting other
await fs.writeFile(path.resolve(tmpdir.path, 'test-runner-concurrency'), '');
const { code, stderr } = await common.spawnPromisified(process.execPath, [
'--test',
Expand Down