Merge pull request #126905 from zhifei92/optimize-assert-for-e2e

Optimizing the context information for assertions on boolean types.
This commit is contained in:
Kubernetes Prow Robot 2024-08-26 23:30:16 +01:00 committed by GitHub
commit 9682c62148
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -129,7 +129,7 @@ while true; do sleep 1; done
ginkgo.By(fmt.Sprintf("Container '%s': should be possible to delete", testContainer.Name))
gomega.Expect(terminateContainer.Delete(ctx)).To(gomega.Succeed())
gomega.Eventually(ctx, terminateContainer.Present, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(gomega.BeFalse())
gomega.Eventually(ctx, terminateContainer.Present, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(gomega.BeFalseBecause("container '%s': should have been terminated by now.", testContainer.Name))
}
})
})

View File

@ -259,17 +259,17 @@ var _ = utils.SIGDescribe("CSI Mock volume storage capacity", func() {
// test.
framework.Logf("PVC watch delivered incomplete data, cannot check annotation")
case test.lateBinding:
gomega.Expect(nodeAnnotationSet).To(gomega.BeTrue(), "selected-node should have been set")
gomega.Expect(nodeAnnotationSet).To(gomega.BeTrueBecause("selected-node should have been set"))
// Whether it gets reset depends on whether we have topology enabled. Without
// it, rescheduling is unnecessary.
if test.topology {
gomega.Expect(nodeAnnotationReset).To(gomega.BeTrue(), "selected-node should have been set")
gomega.Expect(nodeAnnotationReset).To(gomega.BeTrueBecause("selected-node should have been set"))
} else {
gomega.Expect(nodeAnnotationReset).To(gomega.BeFalse(), "selected-node should not have been reset")
gomega.Expect(nodeAnnotationReset).To(gomega.BeFalseBecause("selected-node should not have been reset"))
}
default:
gomega.Expect(nodeAnnotationSet).To(gomega.BeFalse(), "selected-node should not have been set")
gomega.Expect(nodeAnnotationReset).To(gomega.BeFalse(), "selected-node should not have been reset")
gomega.Expect(nodeAnnotationSet).To(gomega.BeFalseBecause("selected-node should not have been set"))
gomega.Expect(nodeAnnotationReset).To(gomega.BeFalseBecause("selected-node should not have been reset"))
}
}
})