Unverified Commit 1284c99e authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #77894 from draveness/feature/refactor-test-e2e-apps

feat: use framework.ExpectNoError in e2e apps disruption
parents 066549b4 95a63768
...@@ -166,7 +166,7 @@ var _ = SIGDescribe("DisruptionController", func() { ...@@ -166,7 +166,7 @@ var _ = SIGDescribe("DisruptionController", func() {
// Locate a running pod. // Locate a running pod.
pod, err := locateRunningPod(cs, ns) pod, err := locateRunningPod(cs, ns)
gomega.Expect(err).NotTo(gomega.HaveOccurred()) framework.ExpectNoError(err)
e := &policy.Eviction{ e := &policy.Eviction{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
...@@ -205,7 +205,7 @@ var _ = SIGDescribe("DisruptionController", func() { ...@@ -205,7 +205,7 @@ var _ = SIGDescribe("DisruptionController", func() {
ginkgo.By("First trying to evict a pod which shouldn't be evictable") ginkgo.By("First trying to evict a pod which shouldn't be evictable")
pod, err := locateRunningPod(cs, ns) pod, err := locateRunningPod(cs, ns)
gomega.Expect(err).NotTo(gomega.HaveOccurred()) framework.ExpectNoError(err)
waitForPodsOrDie(cs, ns, 3) // make sure that they are running and so would be evictable with a different pdb waitForPodsOrDie(cs, ns, 3) // make sure that they are running and so would be evictable with a different pdb
e := &policy.Eviction{ e := &policy.Eviction{
...@@ -223,7 +223,7 @@ var _ = SIGDescribe("DisruptionController", func() { ...@@ -223,7 +223,7 @@ var _ = SIGDescribe("DisruptionController", func() {
ginkgo.By("Trying to evict the same pod we tried earlier which should now be evictable") ginkgo.By("Trying to evict the same pod we tried earlier which should now be evictable")
waitForPodsOrDie(cs, ns, 3) waitForPodsOrDie(cs, ns, 3)
err = cs.CoreV1().Pods(ns).Evict(e) err = cs.CoreV1().Pods(ns).Evict(e)
gomega.Expect(err).NotTo(gomega.HaveOccurred()) // the eviction is now allowed framework.ExpectNoError(err) // the eviction is now allowed
}) })
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment