Use ExpectNoError(err)

We missed another pattern to check error doesn't happen on e2e tests.
This covers the pattern for consistent test implementation.
This commit is contained in:
Kenichi Omichi
2020-09-03 18:37:01 +00:00
parent 6ee74bf600
commit 12c0eaef25
8 changed files with 25 additions and 22 deletions

View File

@@ -594,7 +594,7 @@ var _ = SIGDescribe("Kubectl client", func() {
gomega.Expect(runOutput).ToNot(gomega.ContainSubstring("stdin closed"))
g := func(pods []*v1.Pod) sort.Interface { return sort.Reverse(controller.ActivePods(pods)) }
runTestPod, _, err := polymorphichelpers.GetFirstPod(f.ClientSet.CoreV1(), ns, "run=run-test-3", 1*time.Minute, g)
gomega.Expect(err).To(gomega.BeNil())
framework.ExpectNoError(err)
if !e2epod.CheckPodsRunningReady(c, ns, []string{runTestPod.Name}, time.Minute) {
framework.Failf("Pod %q of Job %q should still be running", runTestPod.Name, "run-test-3")
}
@@ -609,7 +609,7 @@ var _ = SIGDescribe("Kubectl client", func() {
gomega.Expect(logOutput).ToNot(gomega.ContainSubstring("stdin closed"))
return strings.Contains(logOutput, "abcd1234"), nil
})
gomega.Expect(err).To(gomega.BeNil())
framework.ExpectNoError(err)
gomega.Expect(c.CoreV1().Pods(ns).Delete(context.TODO(), "run-test-3", metav1.DeleteOptions{})).To(gomega.BeNil())
})