I have a method X making use of crypto/rand. Several unit tests use X.
One of these tests succeeds when running alone, but fails when running all tests in that file (with go test -p 1 ./... -v
).
Even strange, all tests succeeds if this one is on top of the file. It will fail only when another test who calls X gets executed first.
Why is this ? Can anyone give more details about what go test ./...
does in terms of resources, optimizations, inlining, etc ?