From aa52bfe4d66017e76db0c1be30f7f7ad537eba95 Mon Sep 17 00:00:00 2001 From: tanjunchen Date: Sat, 21 Mar 2020 15:51:49 +0800 Subject: [PATCH] use e2epod.WaitForPodRunningInNamespaceSlow directly --- test/e2e/framework/framework.go | 6 ------ test/e2e/network/dns_common.go | 4 ++-- test/e2e/storage/pd.go | 10 +++++----- test/e2e/storage/vsphere/vsphere_stress.go | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 6327e6504d0..7e4e89e8b07 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -525,12 +525,6 @@ func (f *Framework) WaitForPodReady(podName string) error { return e2epod.WaitTimeoutForPodReadyInNamespace(f.ClientSet, podName, f.Namespace.Name, PodStartTimeout) } -// WaitForPodRunningSlow waits for the pod to run in the namespace. -// It has a longer timeout then WaitForPodRunning (util.slowPodStartTimeout). -func (f *Framework) WaitForPodRunningSlow(podName string) error { - return e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, podName, f.Namespace.Name) -} - // ClientConfig an externally accessible method for reading the kube client config. func (f *Framework) ClientConfig() *rest.Config { ret := rest.CopyConfig(f.clientConfig) diff --git a/test/e2e/network/dns_common.go b/test/e2e/network/dns_common.go index 77920276f42..e8691522313 100644 --- a/test/e2e/network/dns_common.go +++ b/test/e2e/network/dns_common.go @@ -584,7 +584,7 @@ func validateDNSResults(f *framework.Framework, pod *v1.Pod, fileNames []string) framework.Failf("ginkgo.Failed to create pod %s/%s: %v", pod.Namespace, pod.Name, err) } - framework.ExpectNoError(f.WaitForPodRunningSlow(pod.Name)) + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, pod.Name, f.Namespace.Name)) ginkgo.By("retrieving the pod") pod, err := podClient.Get(context.TODO(), pod.Name, metav1.GetOptions{}) @@ -612,7 +612,7 @@ func validateTargetedProbeOutput(f *framework.Framework, pod *v1.Pod, fileNames framework.Failf("ginkgo.Failed to create pod %s/%s: %v", pod.Namespace, pod.Name, err) } - framework.ExpectNoError(f.WaitForPodRunningSlow(pod.Name)) + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, pod.Name, f.Namespace.Name)) ginkgo.By("retrieving the pod") pod, err := podClient.Get(context.TODO(), pod.Name, metav1.GetOptions{}) diff --git a/test/e2e/storage/pd.go b/test/e2e/storage/pd.go index 732b31d2a75..b6d720406aa 100644 --- a/test/e2e/storage/pd.go +++ b/test/e2e/storage/pd.go @@ -148,7 +148,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { fmtPod = testPDPod([]string{diskName}, host0Name, false, 1) _, err = podClient.Create(context.TODO(), fmtPod, metav1.CreateOptions{}) framework.ExpectNoError(err, "Failed to create fmtPod") - framework.ExpectNoError(f.WaitForPodRunningSlow(fmtPod.Name)) + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, fmtPod.Name, f.Namespace.Name)) ginkgo.By("deleting the fmtPod") framework.ExpectNoError(podClient.Delete(context.TODO(), fmtPod.Name, *metav1.NewDeleteOptions(0)), "Failed to delete fmtPod") @@ -176,7 +176,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { ginkgo.By("creating host0Pod on node0") _, err = podClient.Create(context.TODO(), host0Pod, metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err)) - framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name)) + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, host0Pod.Name, f.Namespace.Name)) framework.Logf("host0Pod: %q, node0: %q", host0Pod.Name, host0Name) var containerName, testFile, testFileContents string @@ -200,7 +200,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { ginkgo.By("creating host1Pod on node1") _, err = podClient.Create(context.TODO(), host1Pod, metav1.CreateOptions{}) framework.ExpectNoError(err, "Failed to create host1Pod") - framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name)) + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, host1Pod.Name, f.Namespace.Name)) framework.Logf("host1Pod: %q, node1: %q", host1Pod.Name, host1Name) if readOnly { @@ -282,7 +282,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { host0Pod = testPDPod(diskNames, host0Name, false /* readOnly */, numContainers) _, err = podClient.Create(context.TODO(), host0Pod, metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err)) - framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name)) + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, host0Pod.Name, f.Namespace.Name)) ginkgo.By(fmt.Sprintf("writing %d file(s) via a container", numPDs)) containerName := "mycontainer" @@ -385,7 +385,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { _, err = podClient.Create(context.TODO(), host0Pod, metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err)) ginkgo.By("waiting for host0Pod to be running") - framework.ExpectNoError(f.WaitForPodRunningSlow(host0Pod.Name)) + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, host0Pod.Name, f.Namespace.Name)) ginkgo.By("writing content to host0Pod") testFile := "/testpd1/tracker" diff --git a/test/e2e/storage/vsphere/vsphere_stress.go b/test/e2e/storage/vsphere/vsphere_stress.go index 7312e0db2b5..ef9f82db2eb 100644 --- a/test/e2e/storage/vsphere/vsphere_stress.go +++ b/test/e2e/storage/vsphere/vsphere_stress.go @@ -149,7 +149,7 @@ func PerformVolumeLifeCycleInParallel(f *framework.Framework, client clientset.I framework.ExpectNoError(err) ginkgo.By(fmt.Sprintf("%v Waiting for the Pod: %v to be in the running state", logPrefix, pod.Name)) - err = f.WaitForPodRunningSlow(pod.Name) + err = e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, pod.Name, f.Namespace.Name) framework.ExpectNoError(err) // Get the copy of the Pod to know the assigned node name.