Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovic committed Mar 4, 2018
1 parent e4beb17 commit ad59919
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,25 +702,27 @@ func TestServerPoolUpdatedWhenRouteGoesAway(t *testing.T) {
// so try again on failure.
var (
ds []string
timeout = time.Now().Add(3 * time.Second)
timeout = time.Now().Add(5 * time.Second)
)
for time.Now().Before(timeout) {
startCheck:
ds = nc.Servers()
if len(ds) == len(expected) {
m := make(map[string]struct{}, len(ds))
for _, url := range ds {
m[url] = struct{}{}
}
ok := true
for _, url := range expected {
if _, present := m[url]; !present {
time.Sleep(15 * time.Millisecond)
goto startCheck
ok = false
break
}
}
// we are good
return
if ok {
return
}
}
time.Sleep(50 * time.Millisecond)
}
stackFatalf(t, "Expected %v, got %v", expected, ds)
}
Expand Down

0 comments on commit ad59919

Please sign in to comment.