Commit 52c8d164 authored by Mike Danese's avatar Mike Danese

retry pod delete in etcd failure test

parent dafe79e5
...@@ -121,13 +121,18 @@ func checkExistingRCRecovers(f Framework) { ...@@ -121,13 +121,18 @@ func checkExistingRCRecovers(f Framework) {
rcSelector := labels.Set{"name": "baz"}.AsSelector() rcSelector := labels.Set{"name": "baz"}.AsSelector()
By("deleting pods from existing replication controller") By("deleting pods from existing replication controller")
pods, err := podClient.List(rcSelector, fields.Everything()) expectNoError(wait.Poll(time.Millisecond*500, time.Second*30, func() (bool, error) {
Expect(err).NotTo(HaveOccurred()) pods, err := podClient.List(rcSelector, fields.Everything())
Expect(len(pods.Items) > 0).Should(BeTrue())
for _, pod := range pods.Items {
err = podClient.Delete(pod.Name, api.NewDeleteOptions(0))
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
} if len(pods.Items) == 0 {
return false, nil
}
for _, pod := range pods.Items {
err = podClient.Delete(pod.Name, api.NewDeleteOptions(0))
Expect(err).NotTo(HaveOccurred())
}
return true, nil
}))
By("waiting for replication controller to recover") By("waiting for replication controller to recover")
expectNoError(wait.Poll(time.Millisecond*500, time.Second*30, func() (bool, error) { expectNoError(wait.Poll(time.Millisecond*500, time.Second*30, func() (bool, error) {
......
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