Retry calls to ReadFileViaContainer in PD tests

This commit is contained in:
Michelle Au 2017-03-09 14:42:46 -08:00
parent 3a1db2f76b
commit e5189a6dd3

View File

@ -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 */))