mirror of https://github.com/k3s-io/k3s
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**: NONEpull/6/head
commit
8993397a1e
|
@ -118,11 +118,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() {
|
|||
|
||||
framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name))
|
||||
|
||||
v, err := f.ReadFileViaContainer(host1Pod.Name, containerName, testFile)
|
||||
framework.ExpectNoError(err)
|
||||
framework.Logf("Read value: %v", v)
|
||||
|
||||
Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(testFileContents)))
|
||||
verifyPDContentsViaContainer(f, host1Pod.Name, containerName, map[string]string{testFile: testFileContents})
|
||||
|
||||
// Verify that disk is removed from node 1's VolumeInUse list
|
||||
framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */))
|
||||
|
@ -182,11 +178,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() {
|
|||
|
||||
framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name))
|
||||
|
||||
v, err := f.ReadFileViaContainer(host1Pod.Name, containerName, testFile)
|
||||
framework.ExpectNoError(err)
|
||||
framework.Logf("Read value: %v", v)
|
||||
|
||||
Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(testFileContents)))
|
||||
verifyPDContentsViaContainer(f, host1Pod.Name, containerName, map[string]string{testFile: testFileContents})
|
||||
|
||||
// Verify that disk is removed from node 1's VolumeInUse list
|
||||
framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */))
|
||||
|
|
Loading…
Reference in New Issue