Commit a44e538d authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #51039 from enisoc/deflake-sts-saturate

Automatic merge from submit-queue StatefulSet: Deflake e2e "Saturate" phase. This should reduce one source of flakiness found while investigating #48031. The "Saturate" phase of StatefulSet e2e tests verifies orderly startup by controlling when each Pod is allowed to report Ready. If a Pod unexepectedly goes down during the test, the replacement Pod created by the controller will forget if it was already allowed to report Ready. After this change, the signal that allows each Pod to report Ready is persisted in the Pod's PVC. Thus, the replacement Pod will remember that it was already told to proceed to a Ready state.
parents 601b6d3e 3bc76760
...@@ -115,7 +115,7 @@ var _ = SIGDescribe("StatefulSet", func() { ...@@ -115,7 +115,7 @@ var _ = SIGDescribe("StatefulSet", func() {
By("Restarting statefulset " + ss.Name) By("Restarting statefulset " + ss.Name)
sst.Restart(ss) sst.Restart(ss)
sst.Saturate(ss) sst.WaitForRunningAndReady(*ss.Spec.Replicas, ss)
By("Verifying statefulset mounted data directory is usable") By("Verifying statefulset mounted data directory is usable")
framework.ExpectNoError(sst.CheckMount(ss, "/data")) framework.ExpectNoError(sst.CheckMount(ss, "/data"))
...@@ -233,13 +233,13 @@ var _ = SIGDescribe("StatefulSet", func() { ...@@ -233,13 +233,13 @@ var _ = SIGDescribe("StatefulSet", func() {
sst.DeleteStatefulPodAtIndex(0, ss) sst.DeleteStatefulPodAtIndex(0, ss)
By("Confirming stateful pod at index 0 is recreated.") By("Confirming stateful pod at index 0 is recreated.")
sst.WaitForRunning(2, 0, ss) sst.WaitForRunning(2, 1, ss)
By("Deleting unhealthy stateful pod at index 1.") By("Resuming stateful pod at index 1.")
sst.DeleteStatefulPodAtIndex(1, ss) sst.ResumeNextPod(ss)
By("Confirming all stateful pods in statefulset are created.") By("Confirming all stateful pods in statefulset are created.")
sst.Saturate(ss) sst.WaitForRunningAndReady(*ss.Spec.Replicas, ss)
}) })
It("should perform rolling updates and roll backs of template modifications", func() { It("should perform rolling updates and roll backs of template modifications", func() {
......
...@@ -548,7 +548,7 @@ func (s *StatefulSetTester) RestorePodHttpProbe(ss *apps.StatefulSet, pod *v1.Po ...@@ -548,7 +548,7 @@ func (s *StatefulSetTester) RestorePodHttpProbe(ss *apps.StatefulSet, pod *v1.Po
var pauseProbe = &v1.Probe{ var pauseProbe = &v1.Probe{
Handler: v1.Handler{ Handler: v1.Handler{
Exec: &v1.ExecAction{Command: []string{"test", "-f", "/tmp/statefulset-continue"}}, Exec: &v1.ExecAction{Command: []string{"test", "-f", "/data/statefulset-continue"}},
}, },
PeriodSeconds: 1, PeriodSeconds: 1,
SuccessThreshold: 1, SuccessThreshold: 1,
...@@ -586,7 +586,7 @@ func (s *StatefulSetTester) ResumeNextPod(ss *apps.StatefulSet) { ...@@ -586,7 +586,7 @@ func (s *StatefulSetTester) ResumeNextPod(ss *apps.StatefulSet) {
if resumedPod != "" { if resumedPod != "" {
Failf("Found multiple paused stateful pods: %v and %v", pod.Name, resumedPod) Failf("Found multiple paused stateful pods: %v and %v", pod.Name, resumedPod)
} }
_, err := RunHostCmd(pod.Namespace, pod.Name, "touch /tmp/statefulset-continue") _, err := RunHostCmd(pod.Namespace, pod.Name, "touch /data/statefulset-continue")
ExpectNoError(err) ExpectNoError(err)
Logf("Resumed pod %v", pod.Name) Logf("Resumed pod %v", pod.Name)
resumedPod = pod.Name resumedPod = pod.Name
......
...@@ -110,5 +110,5 @@ func (t *StatefulSetUpgradeTest) verify() { ...@@ -110,5 +110,5 @@ func (t *StatefulSetUpgradeTest) verify() {
func (t *StatefulSetUpgradeTest) restart() { func (t *StatefulSetUpgradeTest) restart() {
By("Restarting statefulset " + t.set.Name) By("Restarting statefulset " + t.set.Name)
t.tester.Restart(t.set) t.tester.Restart(t.set)
t.tester.Saturate(t.set) t.tester.WaitForRunningAndReady(*t.set.Spec.Replicas, t.set)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment