Update tests to properly use IsServing

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-08-11 10:30:38 -07:00
parent 7de9ca519c
commit fed5ad4bc5
3 changed files with 22 additions and 25 deletions

View File

@@ -240,14 +240,9 @@ func TestDaemonRestart(t *testing.T) {
<-statusC
serving := false
for i := 0; i < 20; i++ {
serving, err = client.IsServing(ctx)
if serving {
break
}
time.Sleep(100 * time.Millisecond)
}
waitCtx, waitCancel := context.WithTimeout(ctx, 2*time.Second)
serving, err := client.IsServing(waitCtx)
waitCancel()
if !serving {
t.Fatalf("containerd did not start within 2s: %v", err)
}