Browse code

Merge pull request #13387 from cpuguy83/fix_ngroutine_test

Better checking for LogsFollowGoroutinesWithStdout

Alexander Morozov authored on 2015/05/22 04:31:57
Showing 1 changed files
... ...
@@ -414,9 +414,11 @@ func (s *DockerSuite) TestLogsFollowGoroutinesWithStdout(c *check.C) {
414 414
 	for {
415 415
 		select {
416 416
 		case <-t:
417
-			c.Assert(nroutines, check.Equals, getNGoroutines())
417
+			if n := getNGoroutines(); n > nroutines {
418
+				c.Fatalf("leaked goroutines: expected less than or equal to %d, got: %d", nroutines, n)
419
+			}
418 420
 		default:
419
-			if nroutines == getNGoroutines() {
421
+			if n := getNGoroutines(); n <= nroutines {
420 422
 				return
421 423
 			}
422 424
 			time.Sleep(200 * time.Millisecond)