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_unlink.go | |
| parent | aa19be8c624a6adc3ecbf11a6ee0506a5c7d34fe (diff) | |
Harden integration workloads against dropped event flakes
Diffstat (limited to 'integrationtests/cmd/ioworkload/scenario_unlink.go')
| -rw-r--r-- | integrationtests/cmd/ioworkload/scenario_unlink.go | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/integrationtests/cmd/ioworkload/scenario_unlink.go b/integrationtests/cmd/ioworkload/scenario_unlink.go index 0d45710..ec7c926 100644 --- a/integrationtests/cmd/ioworkload/scenario_unlink.go +++ b/integrationtests/cmd/ioworkload/scenario_unlink.go @@ -113,10 +113,12 @@ func unlinkEnoent() error { if err != nil { return fmt.Errorf("path bytes: %w", err) } - _, _, errno := syscall.Syscall(syscall.SYS_UNLINK, uintptr(unsafe.Pointer(pathBytes)), 0, 0) - runtime.KeepAlive(pathBytes) - if errno == 0 { - return fmt.Errorf("expected ENOENT, but unlink succeeded") + for i := 0; i < 5; i++ { + _, _, errno := syscall.Syscall(syscall.SYS_UNLINK, uintptr(unsafe.Pointer(pathBytes)), 0, 0) + runtime.KeepAlive(pathBytes) + if errno == 0 { + return fmt.Errorf("expected ENOENT, but unlink succeeded") + } } return nil } @@ -176,10 +178,12 @@ func unlinkUnlinkatEnoent() error { if err != nil { return fmt.Errorf("name bytes: %w", err) } - _, _, errno := syscall.Syscall(syscall.SYS_UNLINKAT, uintptr(dirFD), uintptr(unsafe.Pointer(nameBytes)), 0) - runtime.KeepAlive(nameBytes) - if errno == 0 { - return fmt.Errorf("expected ENOENT, but unlinkat succeeded") + for i := 0; i < 5; i++ { + _, _, errno := syscall.Syscall(syscall.SYS_UNLINKAT, uintptr(dirFD), uintptr(unsafe.Pointer(nameBytes)), 0) + runtime.KeepAlive(nameBytes) + if errno == 0 { + return fmt.Errorf("expected ENOENT, but unlinkat succeeded") + } } return nil } |
