Fixing a flaky test TestQuotas_RateLimitQuota_ExemptPaths (#12532)

* Fixing a flaky test TestQuotas_RateLimitQuota_ExemptPaths

* fixing a string formatting by removing an extra parameter
This commit is contained in:
hghaf099 2021-09-10 17:41:14 -04:00 committed by GitHub
parent 2f025ef30f
commit 2576be23d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -231,7 +231,7 @@ func TestQuotas_RateLimitQuota_ExemptPaths(t *testing.T) {
ideal := 8 + (7.7 * float64(elapsed) / float64(time.Second))
want := int32(ideal + 1)
require.NotZerof(t, numFail, "expected some requests to fail; numSuccess: %d, elapsed: %d", numSuccess, elapsed)
require.Lessf(t, numSuccess, want, "too many successful requests;numSuccess: %d, numFail: %d, elapsed: %d", want, numSuccess, numFail, elapsed)
require.LessOrEqualf(t, numSuccess, want, "too many successful requests;numSuccess: %d, numFail: %d, elapsed: %d", numSuccess, numFail, elapsed)
// allow time (1s) for rate limit to refill before updating the quota config
time.Sleep(time.Second)