aboutsummaryrefslogtreecommitdiffstats
path: root/server_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'server_test.go')
-rw-r--r--server_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/server_test.go b/server_test.go
index 9b0aaf0..6aa16ad 100644
--- a/server_test.go
+++ b/server_test.go
@@ -109,6 +109,13 @@ func testServer(t *testing.T, refreshInterval time.Duration) (*Server, func()) {
defer cleanup()
t.Fatal(err)
}
+ ts := time.Now()
+ for srv.hosts == nil {
+ time.Sleep(10 * time.Millisecond)
+ if time.Since(ts) > 2*time.Second {
+ t.Fatal("timed out waiting initial hosts to load")
+ }
+ }
return srv, cleanup
}