From 58c501c322a133085b03f75348ecfd9aa2f7dcf2 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Wed, 15 Jul 2020 15:02:54 -0700 Subject: [PATCH] sleeping for 30 seconds works for some reason? --- test/integration/multinode_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/integration/multinode_test.go b/test/integration/multinode_test.go index 9a104cdcc..e97d32d07 100644 --- a/test/integration/multinode_test.go +++ b/test/integration/multinode_test.go @@ -24,6 +24,7 @@ import ( "os/exec" "strings" "testing" + "time" ) func TestMultiNode(t *testing.T) { @@ -238,12 +239,15 @@ func validateRestartMultiNodeCluster(ctx context.Context, t *testing.T, profile t.Errorf("status says both kubelets are not running: args %q: %v", rr.Command(), rr.Output()) } + time.Sleep(Seconds(30)) + // Make sure kubectl reports that all nodes are ready - rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "get", "nodes", "-o", `go-template='{{range .items}}{{range .status.conditions}}{{if eq .type "Ready"}} {{.status}}{{"\n"}}{{end}}{{end}}{{end}}'`)) - if err != nil { - t.Fatalf("failed to kubectl get nodes. args %q : %v", rr.Command(), err) + rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "get", "nodes")) + if strings.Count(rr.Stdout.String(), "NotReady") > 0 { + t.Errorf("expected 2 nodes to be Ready, got %v", rr.Output()) } + rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "get", "nodes", "-o", `go-template='{{range .items}}{{range .status.conditions}}{{if eq .type "Ready"}} {{.status}}{{"\n"}}{{end}}{{end}}{{end}}'`)) if strings.Count(rr.Stdout.String(), "True") != 2 { t.Errorf("expected 2 nodes Ready status to be True, got %v", rr.Output()) } -- GitLab