- Notifications
You must be signed in to change notification settings - Fork1k
test: set test flags from within an init to limit maximum test parallelism#19575
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
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.
LGTM!
Uh oh!
There was an error while loading.Please reload this page.
@@ -0,0 +1,46 @@ | |||
package coderdtest |
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.
Only applies to this pkg? What about others likeclitest
?
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.
We importcoderdtest
in nearly every test. Any test that spins up a coderd will inherit thisinit
function.
If there are some pkgs that do not import this, they probably do not need the parallism limit
3df9d8e
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
What this does
This limits the maximum test parallelism to
8
by default, matching theMakefile
. This will improve the success rate of runninggo test
natively.On systems with less than 8 cores (
GOMAXPROCS < 8
), this code is a no-op. The smaller number will still be the default. On those systems,go test
may still fail due to resource contention between tests.Manually setting
-parallel=<n>
still works exactly as expectedExample test and output with the max parallelism set to 1
When you manually set the parallel: