Merge pull request #99442 from zgfh/fix-stress

[UT] AtMostEvery may result in less than expected times if overloaded
This commit is contained in:
Kubernetes Prow Robot 2021-02-25 13:52:48 -08:00 committed by GitHub
commit 8370316d09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ func TestAtMostEvery(t *testing.T) {
}
}
if expected := int(duration/delay) + 1; count != expected {
t.Fatalf("Function called %d times, should have been called exactly %d times", count, expected)
if expected := int(duration/delay) + 1; count > expected {
t.Fatalf("Function called %d times, should have been called less than or equal to %d times", count, expected)
}
}