Skip to content

Commit

Permalink
CI: K8sFQDNTest retry initial DNS lookups
Browse files Browse the repository at this point in the history
We target jenkins.cilium.io and vagrant-cache.ci.cilium.io as the remote
targets for the FQDN tests. Sometimes, the DNS lookups fail and so does
the test. We now retry for 30 seconds. When your DNS lookup at first
doesn't succeed, try try again.

Signed-off-by: Ray Bejjani <ray@isovalent.com>
  • Loading branch information
raybejjani committed Apr 8, 2020
1 parent ae5588c commit 919f3a3
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions test/k8sT/fqdn.go
Expand Up @@ -45,14 +45,27 @@ var _ = Describe("K8sFQDNTest", func() {
)

BeforeAll(func() {
// In case the IPs changed, update them here
addrs, err := net.LookupHost("vagrant-cache.ci.cilium.io")
Expect(err).Should(BeNil(), "Error getting IPs for test")
worldTargetIP = addrs[0]

addrs, err = net.LookupHost("jenkins.cilium.io")
Expect(err).Should(BeNil(), "Error getting IPs for test")
worldInvalidTargetIP = addrs[0]
// In case the IPs changed from above, update them here
var lookupErr error
err := helpers.WithTimeout(func() bool {
var addrs []string
addrs, lookupErr = net.LookupHost("vagrant-cache.ci.cilium.io")
if lookupErr != nil {
lookupErr = fmt.Errorf("error looking up vagrant-cache.ci.cilium.io: %s", lookupErr)
return false
}
worldTargetIP = addrs[0]

addrs, lookupErr = net.LookupHost("jenkins.cilium.io")
if lookupErr != nil {
lookupErr = fmt.Errorf("error looking up jenkins.cilium.io: %s", lookupErr)
return false
}
worldInvalidTargetIP = addrs[0]

return true
}, "Could not get vagrant-cache.ci.cilium.io and jenkins.cilium.io IPs", &helpers.TimeoutConfig{Timeout: helpers.MidCommandTimeout})
Expect(err).Should(BeNil(), "Error obtaining IPs for test: %s", lookupErr)

kubectl = helpers.CreateKubectl(helpers.K8s1VMName(), logger)
demoManifest = helpers.ManifestGet(kubectl.BasePath(), "demo.yaml")
Expand Down

0 comments on commit 919f3a3

Please sign in to comment.