Skip to content

Commit

Permalink
add wait
Browse files Browse the repository at this point in the history
Signed-off-by: ashnamehrotra <[email protected]>
  • Loading branch information
ashnamehrotra committed Sep 26, 2023
1 parent 94e0f20 commit fa5026d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/e2e/tests/collector_delete_manager/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"sigs.k8s.io/e2e-framework/klient/wait"
"sigs.k8s.io/e2e-framework/klient/wait/conditions"
"sigs.k8s.io/e2e-framework/pkg/envconf"
"sigs.k8s.io/e2e-framework/pkg/features"
)
Expand Down Expand Up @@ -58,6 +60,12 @@ func TestDeleteManager(t *testing.T) {
t.Error("unable to delete eraser-controller-manager pod")
}

// wait for deletion to finish
err = wait.For(conditions.New(c.Resources()).ResourcesDeleted(&podList), wait.WithTimeout(util.Timeout))
if err != nil {
t.Errorf("error waiting for manager pod to be deleted: %v", err)
}

// get new ImageJob
var jobList2 eraserv1alpha1.ImageJobList
err = c.Resources().List(ctx, &jobList2)
Expand Down

0 comments on commit fa5026d

Please sign in to comment.