mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
tests: Wait for the network connectivity first
Some tests are checking the network connectivity using gomega.Consistently, which will fail if any of the checks fails. This could lead to flakyness in some scenarios in which kube-proxy was supposed to apply Policies for Kubernetes services. We can instead wait for the network connectivity to work first using gomega.Eventually, after which we can check the consistency.
This commit is contained in:
parent
7b24c7e4a7
commit
9accb994df
@ -89,12 +89,14 @@ var (
|
||||
)
|
||||
|
||||
func assertConsistentConnectivity(f *framework.Framework, podName string, os string, cmd []string) {
|
||||
gomega.Consistently(func() error {
|
||||
connChecker := func() error {
|
||||
ginkgo.By(fmt.Sprintf("checking connectivity of %s-container in %s", os, podName))
|
||||
// TODO, we should be retrying this similar to what is done in DialFromNode, in the test/e2e/networking/networking.go tests
|
||||
_, _, err := f.ExecCommandInContainerWithFullOutput(podName, os+"-container", cmd...)
|
||||
return err
|
||||
}, duration, pollInterval).ShouldNot(gomega.HaveOccurred())
|
||||
}
|
||||
gomega.Eventually(connChecker, duration, pollInterval).ShouldNot(gomega.HaveOccurred())
|
||||
gomega.Consistently(connChecker, duration, pollInterval).ShouldNot(gomega.HaveOccurred())
|
||||
}
|
||||
|
||||
func linuxCheck(address string, port int) []string {
|
||||
|
Loading…
Reference in New Issue
Block a user