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: t.FailNow should panic if called from wrong goroutine #3800
I expect testing.T.FailNow() to cleanly fail a test, including terminating any running goroutines, and the main routine if it was called in a goroutine. Running `go test` with the attached file, I expect to see "I'm about to fail", followed by the test cleanly failing. Instead I see: $ go test I'm about to fail I'm about to loop forever and the process never terminates. This also happens if the infinite loop is in the main thread. If rather than looping forever, a channel is being waited on, I get a deadlock panic. If I remove the time.Sleep from the test, the test will pass, and then loop forever! Which operating system are you using? Mac OSX 10.6.8 x64 Which version are you using? (run 'go version') $ go version go version go1.0.2
This issue was closed.