-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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 StatefulSet e2e flake #42367
Fix StatefulSet e2e flake #42367
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 |
---|---|---|
|
@@ -217,6 +217,7 @@ var _ = framework.KubeDescribe("StatefulSet", func() { | |
|
||
By("Before scale up finished setting 2nd pod to be not ready by breaking readiness probe") | ||
sst.BreakProbe(ss, testProbe) | ||
sst.WaitForStatus(ss, 0) | ||
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. Shouldn't this be 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. status.Replicas should always be 1 here regardless of the pod being ready or not. It seems that this is not the case actually and we treat this field as ReadyReplicas for ReplicaSets/Deployments (DaemonSets have a different name but there is still a separation between created and ready in the status). So the test seems fine but API-wise I think there is an unnecessary incosistency between the workload apis. |
||
sst.WaitForRunningAndNotReady(2, ss) | ||
|
||
By("Continue scale operation after the 2nd pod, and scaling down to 1 replica") | ||
|
@@ -280,6 +281,7 @@ var _ = framework.KubeDescribe("StatefulSet", func() { | |
By("Confirming that stateful set scale up will halt with unhealthy stateful pod") | ||
sst.BreakProbe(ss, testProbe) | ||
sst.WaitForRunningAndNotReady(*ss.Spec.Replicas, ss) | ||
sst.WaitForStatus(ss, 0) | ||
sst.UpdateReplicas(ss, 3) | ||
sst.ConfirmStatefulPodCount(1, ss, 10*time.Second) | ||
|
||
|
@@ -309,6 +311,7 @@ var _ = framework.KubeDescribe("StatefulSet", func() { | |
Expect(err).NotTo(HaveOccurred()) | ||
|
||
sst.BreakProbe(ss, testProbe) | ||
sst.WaitForStatus(ss, 0) | ||
sst.WaitForRunningAndNotReady(3, ss) | ||
sst.UpdateReplicas(ss, 0) | ||
sst.ConfirmStatefulPodCount(3, ss, 10*time.Second) | ||
|
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.
Update this to also check that ss.Status.ObservedGeneration >= ss.Generation.
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 just realized that observedGeneration is not working for StatefulSets and sent a PR: #42429
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.
@Kargakis Using this code
The observed generation of both ss and ssGet are always nil. However the generation appears to increment consistently.
what about the following
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.
@Kargakis just saw the above do you want to wait until #42429 merges before submitting this?
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.
Yes, I just tagged it with a manual approval since the hack changes were minimal and it should be merged when you get back online:) Once you update this helper with the new check feel free to apply lgtm