Files
grpc-go/backoff_test.go
Stephen J Day 9ff38e9093 backoff: set default values on BackoffConfig
Because most of the fields on `BackoffConfig` are unexported, correctly
using the config requires copying from the default. This sets the
defaults appropriately and falls back to a default if MaxDelay is
negative or zero.

Tests are added to ensure that the backoff is set correctly in common
use cases.

Signedroff-by: Stephen J Day <stephen.day@docker.com>
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-04-15 16:12:47 -07:00

12 lines
258 B
Go

package grpc
import "testing"
func TestBackoffConfigDefaults(t *testing.T) {
b := BackoffConfig{}
b.setDefaults()
if b != *DefaultBackoffConfig {
t.Fatalf("expected BackoffConfig to pickup default parameters: %v != %v", b, *DefaultBackoffConfig)
}
}