Skip to content
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

e2e: deflake wait.Until in StatefulSet test #45103

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/e2e/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,16 @@ var _ = framework.KubeDescribe("StatefulSet", func() {
expectedPodName := ss.Name + "-1"
expectedPod, err := f.ClientSet.Core().Pods(ns).Get(expectedPodName, metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred())

By("Verifying the 2nd pod is removed only when it becomes running and ready")
sst.RestoreProbe(ss, testProbe)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This calls RunHostCmd which is a simple exec into the pod though, no real host command as it was long ago. So this shouldn't take long (only does a file move). Hence, I guess this change doesn't make much of a difference. The issue we see is that watch.Until can return with Keep waiting, received error from watch event: too old resource version: 7504 (7561).

watcher, err := f.ClientSet.Core().Pods(ns).Watch(metav1.SingleObject(
metav1.ObjectMeta{
Name: expectedPod.Name,
ResourceVersion: expectedPod.ResourceVersion,
},
))
Expect(err).NotTo(HaveOccurred())

By("Verifying the 2nd pod is removed only when it becomes running and ready")
sst.RestoreProbe(ss, testProbe)
_, err = watch.Until(framework.StatefulSetTimeout, watcher, func(event watch.Event) (bool, error) {
pod := event.Object.(*v1.Pod)
if event.Type == watch.Deleted && pod.Name == expectedPodName {
Expand Down