-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
testing: parallel starts tests even when -parallel=1 #15069
Comments
Looks like a bug to me. |
I touched this code last so I'll take it. |
This seems like intended behavior to me. Note that the timeout is defined for the aggregate time of all tests:
In the "go test -timeout=1s -v" run, all your parallel tests get run in parallel and are able to complete within the given timeout (by chance, I guess). In the "go test -timeout=1s -parallel=1 -v" run, as the parallel test are run in sequence, it is guaranteed to panic. On my install, I see a PASS for the first test (both for an old version of go and the one including my changes). But I guess it depends on how lucky you are, as the timeout is so close to the running time. |
working as intended. |
It looks like the test runner "starts" the timer for the tests even though the test code doesn't start executing. This results in a faulty test timeout.
go version devel +edb19aa Fri Mar 25 18:35:15 2016 +0000 linux/amd64
The text was updated successfully, but these errors were encountered: