Skip to content

Commit 87165cb

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 77ecb13 commit 87165cb

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
@@ -801,7 +801,12 @@ func checkDataPersist(pvcPath, appPath string, f *framework.Framework) error {
801801
// write data to PVC
802802
filePath := app.Spec.Containers[0].VolumeMounts[0].MountPath + "/test"
803803

804-
_, stdErr, err := execCommandInPod(f, fmt.Sprintf("echo %s > %s", data, filePath), app.Namespace, &opt)
804+
_, stdErr, err := execCommandInPod(
805+
f,
806+
fmt.Sprintf("echo -n '%s' | dd of=%s conv=fsync", data, filePath),
807+
app.Namespace,
808+
&opt,
809+
)
805810
if err != nil {
806811
return fmt.Errorf("failed to exec command in pod: %w", err)
807812
}

0 commit comments

Comments
 (0)