From 9e3209c77da585e52f9f5faa44c0835e6e6cc3aa Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Fri, 7 May 2021 13:35:39 +0000 Subject: [PATCH] test: fix containerd Windows e2e test failure fix deployment test --- hack/verify-examples.sh | 4 ++-- .../dynamically_provisioned_delete_pod_tester.go | 8 ++++++-- .../dynamically_provisioned_statefulset_tester.go | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/hack/verify-examples.sh b/hack/verify-examples.sh index 01d955dcdf..26d7d7170d 100755 --- a/hack/verify-examples.sh +++ b/hack/verify-examples.sh @@ -31,8 +31,8 @@ if [[ "$1" == "windows" ]]; then kubectl apply -f deploy/example/storageclass-azurefile-csi.yaml kubectl apply -f deploy/example/windows/deployment.yaml kubectl apply -f deploy/example/windows/statefulset.yaml - echo "sleep 240s ..." - sleep 240 + echo "sleep 360s ..." + sleep 360 fi echo "begin to check pod status ..." diff --git a/test/e2e/testsuites/dynamically_provisioned_delete_pod_tester.go b/test/e2e/testsuites/dynamically_provisioned_delete_pod_tester.go index ac0f95147d..95e5b114bc 100644 --- a/test/e2e/testsuites/dynamically_provisioned_delete_pod_tester.go +++ b/test/e2e/testsuites/dynamically_provisioned_delete_pod_tester.go @@ -17,6 +17,8 @@ limitations under the License. package testsuites import ( + "time" + "sigs.k8s.io/azurefile-csi-driver/test/e2e/driver" "github.com/onsi/ginkgo" @@ -53,7 +55,8 @@ func (t *DynamicallyProvisionedDeletePodTest) Run(client clientset.Interface, na tDeployment.WaitForPodReady() if t.PodCheck != nil { - ginkgo.By("checking pod exec") + time.Sleep(time.Second) + ginkgo.By("sleep 1s and then check pod exec") tDeployment.Exec(t.PodCheck.Cmd, t.PodCheck.ExpectedString) } @@ -64,7 +67,8 @@ func (t *DynamicallyProvisionedDeletePodTest) Run(client clientset.Interface, na tDeployment.WaitForPodReady() if t.PodCheck != nil { - ginkgo.By("checking pod exec") + time.Sleep(time.Second) + ginkgo.By("sleep 1s and then check pod exec") // pod will be restarted so expect to see 2 instances of string tDeployment.Exec(t.PodCheck.Cmd, t.PodCheck.ExpectedString+t.PodCheck.ExpectedString) } diff --git a/test/e2e/testsuites/dynamically_provisioned_statefulset_tester.go b/test/e2e/testsuites/dynamically_provisioned_statefulset_tester.go index cc3eb11ee1..3128199521 100644 --- a/test/e2e/testsuites/dynamically_provisioned_statefulset_tester.go +++ b/test/e2e/testsuites/dynamically_provisioned_statefulset_tester.go @@ -17,6 +17,8 @@ limitations under the License. package testsuites import ( + "time" + "github.com/onsi/ginkgo" v1 "k8s.io/api/core/v1" clientset "k8s.io/client-go/kubernetes" @@ -46,7 +48,8 @@ func (t *DynamicallyProvisionedStatefulSetTest) Run(client clientset.Interface, tStatefulSet.WaitForPodReady() if t.PodCheck != nil { - ginkgo.By("checking pod exec") + time.Sleep(time.Second) + ginkgo.By("sleep 1s and then check pod exec") tStatefulSet.Exec(t.PodCheck.Cmd, t.PodCheck.ExpectedString) } @@ -57,7 +60,8 @@ func (t *DynamicallyProvisionedStatefulSetTest) Run(client clientset.Interface, tStatefulSet.WaitForPodReady() if t.PodCheck != nil { - ginkgo.By("checking pod exec after pod restart again") + time.Sleep(time.Second) + ginkgo.By("sleep 1s and then check pod exec after pod restart again") // pod will be restarted so expect to see 2 instances of string tStatefulSet.Exec(t.PodCheck.Cmd, t.PodCheck.ExpectedString+t.PodCheck.ExpectedString) }