remove backoff unit test
This commit is contained in:
@ -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
|
// bmEncode benchmarks encoding a Protocol Buffer message containing mSize
|
||||||
// bytes.
|
// bytes.
|
||||||
func bmEncode(b *testing.B, mSize int) {
|
func bmEncode(b *testing.B, mSize int) {
|
||||||
|
Reference in New Issue
Block a user