Skip to content

Commit 178304f

Browse files
authored
test(condition): fixed flaky test (#40)
* fixes #38 Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
1 parent a860545 commit 178304f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/assertions/condition_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func TestConditionEventuallyWithT(t *testing.T) {
238238
Len(t, mock.errors, expectedErrors, "expected 2 errors from the condition, and 2 additional errors from Eventually")
239239

240240
expectedCalls := int(testTimeout / testTick)
241-
if counter != expectedCalls && counter != expectedCalls+1 { // it may be 5 or 6 depending on how the test schedules
241+
if counter < expectedCalls-1 || counter > expectedCalls+1 { // it may be 4, 5 or 6 depending on how the test schedules
242242
t.Errorf("expected %d calls to the condition, but got %d", expectedCalls, counter)
243243
}
244244
})

0 commit comments

Comments
 (0)