Skip to content

Commit

Permalink
Wait until all Pods are deleted in E2E
Browse files Browse the repository at this point in the history
Signed-off-by: d-kuro <kurosawa7620@gmail.com>
  • Loading branch information
d-kuro committed Mar 12, 2023
1 parent fc9ea7d commit 68e4f7a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion e2e/backup_gcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,21 @@ var _ = Context("backup-gcs", func() {
})

It("should delete namespace", func() {
kubectlSafe(nil, "delete", "ns", "backup-gcs")
kubectlSafe(nil, "delete", "-n", "backup-gcs", "mysqlclusters", "--all")

Eventually(func() error {
out, err := kubectl(nil, "get", "-n", "backup-gcs", "pod", "-o", "json")
if err != nil {
return err
}
pods := &corev1.PodList{}
if err := json.Unmarshal(out, pods); err != nil {
return err
}
if len(pods.Items) > 0 {
return errors.New("wait until all Pods are deleted")
}
return nil
}).Should(Succeed())
})
})

0 comments on commit 68e4f7a

Please sign in to comment.