-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flaky e2e tests #2283
Fix flaky e2e tests #2283
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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;") | ||||||
|
@@ -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) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this necessary considering we wait for the pods to become "ready" at ingress-nginx/test/e2e/framework/framework.go Line 273 in ee46f48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it matches on the old generation of pods and instantly returns There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, thanks! -- I wonder if it would be better to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's indeed a good idea. I toyed a little around with checking if the deployments I wonder what the best approach to check if a new generation of a deployment was fully rolled out is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe as a more generic solution we could get the list of currently running pod names at ingress-nginx/test/e2e/framework/framework.go Line 264 in ee46f48
WaitForPodsReady and in that function on top of requiring given number of running pods also require that the names of pods are not in the list of old pods(if any given). That way before returning in WaitForPodsReady we would also guarantee that it is the new pods that are ready.
|
||||||
return nil | ||||||
}) | ||||||
} | ||||||
|
||||||
|
@@ -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 | ||||||
}) | ||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree this is really not great to
sleep
here but the reason I added it here was that I sometimes was getting timeout in the belowWaitForNginxServer
function where it was not able to find ready ingress-nginx-controller pod.