From c7273a81a52a2270218b138d6a1114585e5bf8f7 Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Tue, 28 Jul 2015 12:29:37 -0700 Subject: [PATCH] remove backoff unit test --- rpc_util_test.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/rpc_util_test.go b/rpc_util_test.go index 56cac3301..809899619 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) {