Skip to content

Commit

Permalink
fix: test data race
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Nov 8, 2022
1 parent 9135bf5 commit 2c25cf4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)
Expand All @@ -128,6 +128,4 @@ func TestClientRegistrationAndDiscoveryAsync(t *testing.T) {
pi := <-ch
checkPeerInfo(t, pi, hosts[1+i])
}

DiscoverAsyncInterval = 2 * time.Minute
}

0 comments on commit 2c25cf4

Please sign in to comment.