Skip to content

Commit

Permalink
tests: Wait for the network connectivity first
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
claudiubelu committed Sep 20, 2021
1 parent 8724967 commit 863ca51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/e2e/windows/hybrid_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 863ca51

Please sign in to comment.