Skip to content

Commit

Permalink
Merge pull request #230 from chewong/deflake
Browse files Browse the repository at this point in the history
test: deflake deployment test case
  • Loading branch information
k8s-ci-robot committed Apr 3, 2020
2 parents a7f1c9f + 79e3f8f commit 7c9a307
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/e2e/dynamic_provisioning_test.go
Expand Up @@ -189,10 +189,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
}

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 @@ -438,7 +438,7 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
Pod: pod,
PodCheck: &testsuites.PodExecCheck{
Cmd: []string{"cat", "/mnt/test-1/data"},
ExpectedString: "hello world\nhello world\n", // pod will be restarted so expect to see 2 instances of string
ExpectedString: "hello world\n",
},
StorageClassParameters: map[string]string{"skuName": "Standard_LRS", "fsType": "xfs"},
}
Expand Down
Expand Up @@ -52,6 +52,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 @@ -60,6 +65,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 7c9a307

Please sign in to comment.