mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #9492 from mikedanese/e2e-etcd-sigkill
Etcd e2e: retry pod delete if etcd is slow to come back from a SIGKILL
This commit is contained in:
commit
c1e9a413a3
@ -121,13 +121,18 @@ func checkExistingRCRecovers(f Framework) {
|
||||
rcSelector := labels.Set{"name": "baz"}.AsSelector()
|
||||
|
||||
By("deleting pods from existing replication controller")
|
||||
pods, err := podClient.List(rcSelector, fields.Everything())
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(len(pods.Items) > 0).Should(BeTrue())
|
||||
for _, pod := range pods.Items {
|
||||
err = podClient.Delete(pod.Name, api.NewDeleteOptions(0))
|
||||
expectNoError(wait.Poll(time.Millisecond*500, time.Second*30, func() (bool, error) {
|
||||
pods, err := podClient.List(rcSelector, fields.Everything())
|
||||
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")
|
||||
expectNoError(wait.Poll(time.Millisecond*500, time.Second*30, func() (bool, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user