Skip to content

Commit 5f135f6

Browse files
committed
use same error path as timeout
1 parent 0213fa4 commit 5f135f6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

assert/assertions.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,11 +2049,12 @@ func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick t
20492049
case v := <-resultCh:
20502050
switch v {
20512051
case failed:
2052-
// Conditon pannicked or test failed and finished.
2052+
// Condition panicked or test failed and finished.
20532053
// Cannot determine correct result.
2054-
// Cannot decide if we should continue or not.
2055-
// Stop here and now, and mark test as failed.
2056-
return Fail(t, "Condition aborted")
2054+
// Cannot decide if we should continue gracefully or not.
2055+
// We can stop here and now, and mark test as failed by
2056+
// triggering the same error path as the timeout case.
2057+
timer.Stop()
20572058
case stop:
20582059
return true
20592060
case noStop:

0 commit comments

Comments
 (0)