Skip to content

Commit

Permalink
Merge pull request #345 from chewong/deflake
Browse files Browse the repository at this point in the history
test: deflake deployment test case
  • Loading branch information
andyzhangx committed Apr 3, 2020
2 parents 35ca3d2 + 43d2a75 commit 83b329a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/e2e/dynamic_provisioning_test.go
Expand Up @@ -272,10 +272,10 @@ func (t *dynamicProvisioningTestSuite) defineTests(isMultiZone bool) {
}

podCheckCmd := []string{"cat", "/mnt/test-1/data"}
expectedString := "hello world\nhello world\n"
expectedString := "hello world\n"
if isWindowsCluster {
podCheckCmd = []string{"powershell.exe", "cat", "C:\\mnt\\test-1\\data.txt"}
expectedString = "hello world\r\nhello world\r\n"
expectedString = "hello world\r\n"
}
test := testsuites.DynamicallyProvisionedDeletePodTest{
CSIDriver: testDriver,
Expand Down
Expand Up @@ -51,6 +51,11 @@ func (t *DynamicallyProvisionedDeletePodTest) Run(client clientset.Interface, na
ginkgo.By("checking that the pod is running")
tDeployment.WaitForPodReady()

if t.PodCheck != nil {
ginkgo.By("checking pod exec")
tDeployment.Exec(t.PodCheck.Cmd, t.PodCheck.ExpectedString)
}

ginkgo.By("deleting the pod for deployment")
tDeployment.DeletePodAndWait()

Expand All @@ -59,6 +64,7 @@ func (t *DynamicallyProvisionedDeletePodTest) Run(client clientset.Interface, na

if t.PodCheck != nil {
ginkgo.By("checking pod exec")
tDeployment.Exec(t.PodCheck.Cmd, t.PodCheck.ExpectedString)
// pod will be restarted so expect to see 2 instances of string
tDeployment.Exec(t.PodCheck.Cmd, t.PodCheck.ExpectedString+t.PodCheck.ExpectedString)
}
}

0 comments on commit 83b329a

Please sign in to comment.