Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
testing: parallel starts tests even when -parallel=1 #15069
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
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.