-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test concurrency flag #43887
Merged
Merged
Add test concurrency flag #43887
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
060c851
test_runner: introduces test_concurrency flag
98lenvi 7613bdd
test_runner: use flag for root concurrency
98lenvi 947d7ba
test_runner: fix concurrently flag documentation
98lenvi 0bd2eed
test_runner: use exiting option instead of cli
98lenvi ca04bb6
test_runner: add test cases for concurrency
98lenvi b7bf594
test_runner: imports in alphabetical order
98lenvi cc867b4
test_runner: fix linting in tests
98lenvi f44d1b4
doc: update for concurrency option in test
98lenvi 3834d49
doc: format test
98lenvi 8634f8a
test_runner: update test + update docs
98lenvi 28b7d0e
test_runner: update test support less than 2 core
98lenvi d1a0b79
Revert "test_runner: update test support less than 2 core"
98lenvi 58d8fdf
doc: update concurrency in test
98lenvi 8cc4c10
test_runner: add comment in test case
98lenvi 03c1313
test_runner: apply suggestions
98lenvi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
require('../common'); | ||
const { describe, it } = require('node:test'); | ||
const assert = require('assert'); | ||
|
||
describe('Concurrency option (boolean) = true ', { concurrency: true }, () => { | ||
aduh95 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
let isFirstTestOver = false; | ||
it('should start the first test', () => new Promise((resolve) => { | ||
setImmediate(() => { isFirstTestOver = true; resolve(); }); | ||
})); | ||
it('should start before the previous test ends', () => { | ||
// Should work even on single core CPUs | ||
assert.strictEqual(isFirstTestOver, false); | ||
}); | ||
}); | ||
|
||
describe( | ||
'Concurrency option (boolean) = false ', | ||
{ concurrency: false }, | ||
() => { | ||
let isFirstTestOver = false; | ||
it('should start the first test', () => new Promise((resolve) => { | ||
setImmediate(() => { isFirstTestOver = true; resolve(); }); | ||
})); | ||
it('should start after the previous test ends', () => { | ||
assert.strictEqual(isFirstTestOver, true); | ||
}); | ||
} | ||
); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have mislead you - it is currently impossible to configure concurrency in
--test
modeso this docs only refers to normal tests, meaning default is
Infinity