Commit 8993397a authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #42846 from msau42/pd-flake

Automatic merge from submit-queue Retry calls to ReadFileViaContainer in PD tests **What this PR does / why we need it**: kubectl exec occasionally fails to return a valid output string. It seems to be an issue with docker #34256. This PR retries the 'kubectl exec' call to workaround the issue. This should fix the flaky PD test issues. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #28283 **Release note**: NONE
parents 222f69cf e5189a6d
...@@ -118,11 +118,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() { ...@@ -118,11 +118,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() {
framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name)) framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name))
v, err := f.ReadFileViaContainer(host1Pod.Name, containerName, testFile) verifyPDContentsViaContainer(f, host1Pod.Name, containerName, map[string]string{testFile: testFileContents})
framework.ExpectNoError(err)
framework.Logf("Read value: %v", v)
Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(testFileContents)))
// Verify that disk is removed from node 1's VolumeInUse list // Verify that disk is removed from node 1's VolumeInUse list
framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */)) framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */))
...@@ -182,11 +178,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() { ...@@ -182,11 +178,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() {
framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name)) framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name))
v, err := f.ReadFileViaContainer(host1Pod.Name, containerName, testFile) verifyPDContentsViaContainer(f, host1Pod.Name, containerName, map[string]string{testFile: testFileContents})
framework.ExpectNoError(err)
framework.Logf("Read value: %v", v)
Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(testFileContents)))
// Verify that disk is removed from node 1's VolumeInUse list // Verify that disk is removed from node 1's VolumeInUse list
framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */)) framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment