testing: go test -parallel=N where N < 1 panics with a deadlock #20542
Comments
Also worth noting that I likely don't want to make the |
Yes, I suppose an error is better than a panic. |
Change https://golang.org/cl/54150 mentions this issue: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?go version devel +32764f7726 Wed May 31 17:59:09 2017 +0100 linux/amd64
Also on 1.8.3.
What operating system and processor architecture are you using (
go env
)?not relevant
What did you do?
While investigating #19280, I ran
go test -parallel=0
andgo test -parallel=-1
(on some trivial parallel tests) to see what would happen without any changes to the testing package.What did you expect to see?
An error, like "N must be a positive integer".
What did you see instead?
The tests themselves are silly examples - this is reproducible with any set of parallel tests. If none of the tests call
t.Parallel()
the panic doesn't occur, supposedly becauseN
isn't used at all.I realise this is somewhat expected, but we should error instead of panicking. Happy to work on a CL if my thinking is correct.
/cc @mpvl @josharian
The text was updated successfully, but these errors were encountered: