Skip to content

Commit

Permalink
Fix unexpected goroutine for long runnign tests
Browse files Browse the repository at this point in the history
The background "RunTests" goroutine changes state from:
"chan wait" to "chan wait, waiting for N minutes".

We should ignore suffixes for "chan wait" (similar to the syscall) to
avoid failures on long running tests.

While tests shouldn't run for > a minute, it can happen when debugging
and running the test in a loop.
  • Loading branch information
prashantv committed Apr 26, 2016
1 parent 703b9f8 commit 9ac4f42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testutils/goroutines/verify.go
Expand Up @@ -46,7 +46,7 @@ func filterStacks(stacks []Stack, skipID int, opts *VerifyOpts) []Stack {
func isTestStack(s Stack) bool {
switch funcName := s.firstFunction; funcName {
case "testing.RunTests", "testing.(*T).Run":
return s.State() == "chan receive"
return strings.HasPrefix(s.State(), "chan receive")
case "runtime.goexit":
return strings.HasPrefix(s.State(), "syscall")
default:
Expand Down

0 comments on commit 9ac4f42

Please sign in to comment.