Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve waitForPDBCollectionToBeDeleted in e2e test #88798

Merged
merged 1 commit into from Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/e2e/apps/disruption.go
Expand Up @@ -431,15 +431,17 @@ func deletePDBCollection(cs kubernetes.Interface, ns string) {

func waitForPDBCollectionToBeDeleted(cs kubernetes.Interface, ns string) {
ginkgo.By("Waiting for the PDB collection to be deleted")
wait.PollImmediate(framework.Poll, schedulingTimeout, func() (bool, error) {
err := wait.PollImmediate(framework.Poll, schedulingTimeout, func() (bool, error) {
pdbList, err := cs.PolicyV1beta1().PodDisruptionBudgets(ns).List(context.TODO(), metav1.ListOptions{})
if err != nil {
return false, err
}
framework.ExpectNoError(err, "Listing PDB set in namespace %s", ns)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reviewing.

framework.ExpectEqual(len(pdbList.Items), 0, "Expecting No PDBs returned in namespace %s", ns)
if len(pdbList.Items) != 0 {
return false, nil
}
return true, nil
})
framework.ExpectNoError(err, "Waiting for the PDB collection to be deleted in namespace %s", ns)
}

func createPodsOrDie(cs kubernetes.Interface, ns string, n int) {
Expand Down