mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
tests: Updates the should delete a collection of pods test
We should wait for all 3 pods after we've spawned them, instead of spawning and waiting for them sequentially.
This commit is contained in:
parent
c964ef8d8a
commit
720ffb826a
@ -866,14 +866,12 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
}}, metav1.CreateOptions{})
|
}}, metav1.CreateOptions{})
|
||||||
framework.ExpectNoError(err, "failed to create pod")
|
framework.ExpectNoError(err, "failed to create pod")
|
||||||
framework.Logf("created %v", podTestName)
|
framework.Logf("created %v", podTestName)
|
||||||
framework.ExpectNoError(e2epod.WaitForPodNameRunningInNamespace(f.ClientSet, podTestName, f.Namespace.Name))
|
|
||||||
framework.Logf("running and ready %v", podTestName)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait as required for all 3 pods to be found
|
// wait as required for all 3 pods to be running
|
||||||
ginkgo.By("waiting for all 3 pods to be located")
|
ginkgo.By("waiting for all 3 pods to be running")
|
||||||
err := wait.PollImmediate(podRetryPeriod, podRetryTimeout, checkPodListQuantity(f, "type=Testing", 3))
|
err := e2epod.WaitForPodsRunningReady(f.ClientSet, f.Namespace.Name, 3, 0, framework.PodStartTimeout, nil)
|
||||||
framework.ExpectNoError(err, "3 pods not found")
|
framework.ExpectNoError(err, "3 pods not found running.")
|
||||||
|
|
||||||
// delete Collection of pods with a label in the current namespace
|
// delete Collection of pods with a label in the current namespace
|
||||||
err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{GracePeriodSeconds: &one}, metav1.ListOptions{
|
err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{GracePeriodSeconds: &one}, metav1.ListOptions{
|
||||||
|
Loading…
Reference in New Issue
Block a user