diff --git a/client_test.go b/client_test.go index 7a45d2d..24ccc5a 100644 --- a/client_test.go +++ b/client_test.go @@ -93,6 +93,8 @@ func TestClientRegistrationAndDiscovery(t *testing.T) { } func TestClientRegistrationAndDiscoveryAsync(t *testing.T) { + DiscoverAsyncInterval = 1 * time.Second + ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -109,8 +111,6 @@ func TestClientRegistrationAndDiscoveryAsync(t *testing.T) { clients := getRendezvousClients(t, hosts) - DiscoverAsyncInterval = 1 * time.Second - ch, err := clients[0].DiscoverAsync(ctx, "foo1") if err != nil { t.Fatal(err) @@ -128,6 +128,4 @@ func TestClientRegistrationAndDiscoveryAsync(t *testing.T) { pi := <-ch checkPeerInfo(t, pi, hosts[1+i]) } - - DiscoverAsyncInterval = 2 * time.Minute }