diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-23 21:57:35 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-23 21:57:35 +0200 |
| commit | c58ef78b4a79a5cbc9531a74c6e3965ea4c00bc2 (patch) | |
| tree | 29944a45cf7d00d781a232020b327203b1a72b75 /integrationtests/cmd/ioworkload/scenario_dir.go | |
| parent | aa19be8c624a6adc3ecbf11a6ee0506a5c7d34fe (diff) | |
Harden integration workloads against dropped event flakes
Diffstat (limited to 'integrationtests/cmd/ioworkload/scenario_dir.go')
| -rw-r--r-- | integrationtests/cmd/ioworkload/scenario_dir.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/integrationtests/cmd/ioworkload/scenario_dir.go b/integrationtests/cmd/ioworkload/scenario_dir.go index 282c903..81421ec 100644 --- a/integrationtests/cmd/ioworkload/scenario_dir.go +++ b/integrationtests/cmd/ioworkload/scenario_dir.go @@ -195,10 +195,13 @@ func dirChdirEnoent() error { if err != nil { return fmt.Errorf("path bytes: %w", err) } - _, _, errno := syscall.Syscall(syscall.SYS_CHDIR, uintptr(unsafe.Pointer(pathBytes)), 0, 0) - runtime.KeepAlive(pathBytes) - if errno == 0 { - return fmt.Errorf("expected ENOENT, but chdir succeeded") + // Retry a few times to reduce dropped-event flakiness under high load. + for i := 0; i < 5; i++ { + _, _, errno := syscall.Syscall(syscall.SYS_CHDIR, uintptr(unsafe.Pointer(pathBytes)), 0, 0) + runtime.KeepAlive(pathBytes) + if errno == 0 { + return fmt.Errorf("expected ENOENT, but chdir succeeded") + } } return nil } @@ -207,10 +210,13 @@ func dirChdirEnoent() error { // The syscall fails with EBADF, but ior captures the tracepoint on entry. func dirGetdentsEbadf() error { buf := make([]byte, 4096) - _, _, errno := syscall.Syscall(syscall.SYS_GETDENTS64, uintptr(9999), uintptr(unsafe.Pointer(&buf[0])), uintptr(len(buf))) - runtime.KeepAlive(buf) - if errno == 0 { - return fmt.Errorf("expected EBADF, but getdents64 succeeded") + // Retry a few times to reduce flakiness under high integration parallelism. + for i := 0; i < 5; i++ { + _, _, errno := syscall.Syscall(syscall.SYS_GETDENTS64, uintptr(9999), uintptr(unsafe.Pointer(&buf[0])), uintptr(len(buf))) + runtime.KeepAlive(buf) + if errno == 0 { + return fmt.Errorf("expected EBADF, but getdents64 succeeded") + } } return nil } |
