-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
What version of Go are you using (go version)?
1.10.1
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
N/A
What did you do?
t.FailNow() has this godoc:
// FailNow marks the function as having failed and stops its execution
// by calling runtime.Goexit (which then runs all deferred calls in the
// current goroutine).
// Execution will continue at the next test or benchmark.
// FailNow must be called from the goroutine running the
// test or benchmark function, not from other goroutines
// created during the test. Calling FailNow does not stop
// those other goroutines.
It is a common mistake to call t.FailNow() from a goroutine spawned in a test, not the goroutine that is executing the test.
What did you expect to see?
Perhaps it is possible to detect this and let the user know? Maybe a panic/failing test with an explanation what is not right.
What did you see instead?
Nothing, it "works".
Reactions are currently unavailable