mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
e2e kubectl: improve Gomega check
gomega.Succeed is the recommend way of checking for an error. gomega.BeNil prints a less useful failure message.
This commit is contained in:
parent
2695ed6a0a
commit
fdc03dd2f8
@ -398,7 +398,7 @@ func doTestOverWebSockets(bindAddress string, f *framework.Framework) {
|
|||||||
return fmt.Errorf("received the wrong port: %d", p)
|
return fmt.Errorf("received the wrong port: %d", p)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}, time.Minute, 10*time.Second).Should(gomega.BeNil())
|
}, time.Minute, 10*time.Second).Should(gomega.Succeed())
|
||||||
|
|
||||||
gomega.Eventually(func() error {
|
gomega.Eventually(func() error {
|
||||||
channel, msg, err := wsRead(ws)
|
channel, msg, err := wsRead(ws)
|
||||||
@ -412,7 +412,7 @@ func doTestOverWebSockets(bindAddress string, f *framework.Framework) {
|
|||||||
return fmt.Errorf("received the wrong port: %d", p)
|
return fmt.Errorf("received the wrong port: %d", p)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}, time.Minute, 10*time.Second).Should(gomega.BeNil())
|
}, time.Minute, 10*time.Second).Should(gomega.Succeed())
|
||||||
|
|
||||||
ginkgo.By("Sending the expected data to the local port")
|
ginkgo.By("Sending the expected data to the local port")
|
||||||
err = wsWrite(ws, 0, []byte("def"))
|
err = wsWrite(ws, 0, []byte("def"))
|
||||||
@ -436,7 +436,7 @@ func doTestOverWebSockets(bindAddress string, f *framework.Framework) {
|
|||||||
return fmt.Errorf("expected %q from server, got %q", expectedData, buf.Bytes())
|
return fmt.Errorf("expected %q from server, got %q", expectedData, buf.Bytes())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}, time.Minute, 10*time.Second).Should(gomega.BeNil())
|
}, time.Minute, 10*time.Second).Should(gomega.Succeed())
|
||||||
|
|
||||||
ginkgo.By("Verifying logs")
|
ginkgo.By("Verifying logs")
|
||||||
gomega.Eventually(func() (string, error) {
|
gomega.Eventually(func() (string, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user