Commit write to disk in source-pvc filler pod (#1937)

Addresses a flake where the clone target DV is "Succeeded" and empty:
```bash
[WARN] error executing command ["/bin/sh" "-c" "md5sum /pvc/disk.img"], error: command terminated with exit code 1
INFO: stderr: [md5sum: /pvc/disk.img: No such file or directory]
```
What I believe happens here is that the filler pod is not committing writes and directly exiting after the `echo 1245 > disk.img`,
resulting in us cloning an empty pvc and doing a successfull job at it.
Did not see it fail at all with the `&& sync` addition.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
This commit is contained in:
akalenyu 2021-09-15 14:30:26 +03:00 committed by GitHub
parent 2309440cb2
commit f5351b8bd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,7 +135,7 @@ func (f *Framework) CreateAndPopulateSourcePVC(pvcDef *k8sv1.PersistentVolumeCla
// Create the source PVC and populate it with a file, so we can verify the clone. // Create the source PVC and populate it with a file, so we can verify the clone.
sourcePvc, err := f.CreatePVCFromDefinition(pvcDef) sourcePvc, err := f.CreatePVCFromDefinition(pvcDef)
gomega.Expect(err).ToNot(gomega.HaveOccurred()) gomega.Expect(err).ToNot(gomega.HaveOccurred())
pod, err := f.CreatePod(f.NewPodWithPVC(podName, fillCommand, sourcePvc)) pod, err := f.CreatePod(f.NewPodWithPVC(podName, fillCommand+"&& sync", sourcePvc))
gomega.Expect(err).ToNot(gomega.HaveOccurred()) gomega.Expect(err).ToNot(gomega.HaveOccurred())
err = f.WaitTimeoutForPodStatus(pod.Name, k8sv1.PodSucceeded, utils.PodWaitForTime) err = f.WaitTimeoutForPodStatus(pod.Name, k8sv1.PodSucceeded, utils.PodWaitForTime)