Merge pull request #15868 from jmhbnz/main

tests: Deflake TestEtcdGrpcResolverRoundRobin
This commit is contained in:
Benjamin Wang 2023-05-11 05:08:53 +08:00 committed by GitHub
commit e3db9dc616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,9 +123,9 @@ func testEtcdGrpcResolver(t *testing.T, lbPolicy string) {
t.Fatalf("couldn't convert to int: %s", string(lastResponse))
}
// Allow 15% tolerance as round robin is not perfect and we don't want the test to flake
// Allow 25% tolerance as round robin is not perfect and we don't want the test to flake
expected := float64(totalRequests) * 0.5
assert.InEpsilon(t, float64(expected), float64(responses), 0.15, "unexpected total responses from foo: %s", string(lastResponse))
assert.InEpsilon(t, float64(expected), float64(responses), 0.25, "unexpected total responses from foo: %s", string(lastResponse))
}
}