Skip to content

Commit

Permalink
Fix flaky e2e tests by always waiting after redeploying the ingress c…
Browse files Browse the repository at this point in the history
…ontroller (#2283)
  • Loading branch information
alvaroaleman authored and aledbf committed Apr 1, 2018
1 parent ee46f48 commit 9b4d7f2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/e2e/lua/dynamic_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ var _ = framework.IngressNginxDescribe("Dynamic Configuration", func() {
Expect(err).NotTo(HaveOccurred())
Expect(ing).NotTo(BeNil())

time.Sleep(5 * time.Second)

err = f.WaitForNginxServer(host,
func(server string) bool {
return strings.Contains(server, "proxy_pass http://upstream_balancer;")
Expand Down Expand Up @@ -195,7 +193,11 @@ func enableDynamicConfiguration(kubeClientSet kubernetes.Interface) error {
args = append(args, "--enable-dynamic-configuration")
deployment.Spec.Template.Spec.Containers[0].Args = args
_, err := kubeClientSet.AppsV1beta1().Deployments("ingress-nginx").Update(deployment)
return err
if err != nil {
return err
}
time.Sleep(15 * time.Second)
return nil
})
}

Expand All @@ -211,7 +213,11 @@ func disableDynamicConfiguration(kubeClientSet kubernetes.Interface) error {
}
deployment.Spec.Template.Spec.Containers[0].Args = newArgs
_, err := kubeClientSet.AppsV1beta1().Deployments("ingress-nginx").Update(deployment)
return err
if err != nil {
return err
}
time.Sleep(15 * time.Second)
return nil
})
}

Expand Down

0 comments on commit 9b4d7f2

Please sign in to comment.