mirror of https://github.com/grpc/grpc-go.git
remove backoff unit test
This commit is contained in:
parent
bce3d5e24b
commit
c7273a81a5
|
@ -153,25 +153,6 @@ func TestContextErr(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestBackoff(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
retries int
|
||||
maxResult time.Duration
|
||||
}{
|
||||
{0, time.Second},
|
||||
{1, time.Duration(1e9 * math.Pow(backoffFactor, 1))},
|
||||
{2, time.Duration(1e9 * math.Pow(backoffFactor, 2))},
|
||||
{3, time.Duration(1e9 * math.Pow(backoffFactor, 3))},
|
||||
{4, time.Duration(1e9 * math.Pow(backoffFactor, 4))},
|
||||
{int(math.Log2(float64(maxDelay)/float64(baseDelay))) + 1, maxDelay},
|
||||
} {
|
||||
delay := backoff(test.retries)
|
||||
if delay < 0 || delay > test.maxResult {
|
||||
t.Errorf("backoff(%d) = %v outside [0, %v]", test.retries, delay, test.maxResult)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// bmEncode benchmarks encoding a Protocol Buffer message containing mSize
|
||||
// bytes.
|
||||
func bmEncode(b *testing.B, mSize int) {
|
||||
|
|
Loading…
Reference in New Issue