Skip to content

Commit 18859aa

Browse files
nixpanicbatrick
andcommitted
e2e: report an error if writing persistent data fails
Use `dd` to sync the data, do not wait for unmounting to flush outstanding I/O (and ignore failed writes). See-also: https://tracker.ceph.com/issues/73997?#note-27 Co-authored-by: Patrick Donnelly <pdonnell@ibm.com> Signed-off-by: Niels de Vos <ndevos@ibm.com>
1 parent 3ea8268 commit 18859aa

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

e2e/utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,12 @@ func checkDataPersist(pvcPath, appPath string, f *framework.Framework) error {
808808
// write data to PVC
809809
filePath := app.Spec.Containers[0].VolumeMounts[0].MountPath + "/test"
810810

811-
_, stdErr, err := execCommandInPod(f, fmt.Sprintf("echo %s > %s", data, filePath), app.Namespace, &opt)
811+
_, stdErr, err := execCommandInPod(
812+
f,
813+
fmt.Sprintf("echo -n '%s' | dd of=%s conv=fsync", data, filePath),
814+
app.Namespace,
815+
&opt,
816+
)
812817
if err != nil {
813818
return fmt.Errorf("failed to exec command in pod: %w", err)
814819
}

0 commit comments

Comments
 (0)