Skip to content

Commit

Permalink
test: don't wait for pods of gone cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
schu committed Sep 6, 2018
1 parent 25b769e commit ac93d5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/e2e/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ac93d5a

Please sign in to comment.