mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	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
This commit is contained in:
		@@ -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() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		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 */))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user