diff --git a/rpc_util_test.go b/rpc_util_test.go index 56cac330..80989961 100644 --- a/rpc_util_test.go +++ b/rpc_util_test.go @@ -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) {