summaryrefslogtreecommitdiff
path: root/integrationtests/cmd/ioworkload/scenario_sync.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-23 21:57:35 +0200
committerPaul Buetow <paul@buetow.org>2026-02-23 21:57:35 +0200
commitc58ef78b4a79a5cbc9531a74c6e3965ea4c00bc2 (patch)
tree29944a45cf7d00d781a232020b327203b1a72b75 /integrationtests/cmd/ioworkload/scenario_sync.go
parentaa19be8c624a6adc3ecbf11a6ee0506a5c7d34fe (diff)
Harden integration workloads against dropped event flakes
Diffstat (limited to 'integrationtests/cmd/ioworkload/scenario_sync.go')
-rw-r--r--integrationtests/cmd/ioworkload/scenario_sync.go24
1 files changed, 15 insertions, 9 deletions
diff --git a/integrationtests/cmd/ioworkload/scenario_sync.go b/integrationtests/cmd/ioworkload/scenario_sync.go
index db6b08f..df1c59c 100644
--- a/integrationtests/cmd/ioworkload/scenario_sync.go
+++ b/integrationtests/cmd/ioworkload/scenario_sync.go
@@ -103,9 +103,11 @@ func syncSyncFileRangeToEOF() error {
// syncFsyncEbadf calls fsync on an invalid fd.
// The syscall fails with EBADF, but ior captures the enter_fsync tracepoint.
func syncFsyncEbadf() error {
- _, _, errno := syscall.Syscall(syscall.SYS_FSYNC, 99999, 0, 0)
- if errno == 0 {
- return fmt.Errorf("expected EBADF, but fsync succeeded")
+ for i := 0; i < 5; i++ {
+ _, _, errno := syscall.Syscall(syscall.SYS_FSYNC, 99999, 0, 0)
+ if errno == 0 {
+ return fmt.Errorf("expected EBADF, but fsync succeeded")
+ }
}
return nil
}
@@ -113,9 +115,11 @@ func syncFsyncEbadf() error {
// syncFdatasyncEbadf calls fdatasync on an invalid fd.
// The syscall fails with EBADF, but ior captures the enter_fdatasync tracepoint.
func syncFdatasyncEbadf() error {
- _, _, errno := syscall.Syscall(syscall.SYS_FDATASYNC, 99999, 0, 0)
- if errno == 0 {
- return fmt.Errorf("expected EBADF, but fdatasync succeeded")
+ for i := 0; i < 5; i++ {
+ _, _, errno := syscall.Syscall(syscall.SYS_FDATASYNC, 99999, 0, 0)
+ if errno == 0 {
+ return fmt.Errorf("expected EBADF, but fdatasync succeeded")
+ }
}
return nil
}
@@ -123,9 +127,11 @@ func syncFdatasyncEbadf() error {
// syncFileRangeEbadf calls sync_file_range on an invalid fd.
// The syscall fails with EBADF, but ior captures the enter_sync_file_range tracepoint.
func syncFileRangeEbadf() error {
- _, _, errno := syscall.Syscall6(syscall.SYS_SYNC_FILE_RANGE, 99999, 0, 0, 0, 0, 0)
- if errno == 0 {
- return fmt.Errorf("expected EBADF, but sync_file_range succeeded")
+ for i := 0; i < 5; i++ {
+ _, _, errno := syscall.Syscall6(syscall.SYS_SYNC_FILE_RANGE, 99999, 0, 0, 0, 0, 0)
+ if errno == 0 {
+ return fmt.Errorf("expected EBADF, but sync_file_range succeeded")
+ }
}
return nil
}