From ac93d5ab51d9ea9c762f615c1bd4e4720223d1c1 Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Tue, 4 Sep 2018 12:36:21 +0200 Subject: [PATCH] test: don't wait for pods of gone cluster --- test/e2e/basic_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/e2e/basic_test.go b/test/e2e/basic_test.go index 49dca17d..af820fdc 100644 --- a/test/e2e/basic_test.go +++ b/test/e2e/basic_test.go @@ -26,6 +26,7 @@ import ( "github.com/sensu/sensu-operator/test/e2e/framework" "github.com/minio/minio-go" + "k8s.io/apimachinery/pkg/api/errors" ) func TestCreateCluster(t *testing.T) { @@ -211,7 +212,12 @@ func TestCreateCluster(t *testing.T) { // have to wait until the old members are gone and the new are up remainingPods, err := e2eutil.WaitUntilMembersWithNamesDeleted(t, f.CRClient, 12, sensuCluster, sensuClusterPods...) if err != nil { - t.Fatalf("failed to see members (%v) be deleted in time: %v", remainingPods, err) + statusError, ok := err.(*errors.StatusError) + // If the cluster is not found (404), its members are + // deleted already and we can continue + if !ok || statusError.ErrStatus.Code != 404 { + t.Fatalf("failed to see members (%v) be deleted in time: %v", remainingPods, err) + } } if _, err := e2eutil.WaitUntilSizeReached(t, f.CRClient, clusterSize, 20, sensuCluster); err != nil {