summaryrefslogtreecommitdiff
path: root/integrationtests/cmd/ioworkload/scenario_truncate.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_truncate.go
parentaa19be8c624a6adc3ecbf11a6ee0506a5c7d34fe (diff)
Harden integration workloads against dropped event flakes
Diffstat (limited to 'integrationtests/cmd/ioworkload/scenario_truncate.go')
-rw-r--r--integrationtests/cmd/ioworkload/scenario_truncate.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/integrationtests/cmd/ioworkload/scenario_truncate.go b/integrationtests/cmd/ioworkload/scenario_truncate.go
index 28be152..04288d5 100644
--- a/integrationtests/cmd/ioworkload/scenario_truncate.go
+++ b/integrationtests/cmd/ioworkload/scenario_truncate.go
@@ -69,10 +69,14 @@ func truncateEnoent() error {
if err != nil {
return fmt.Errorf("path bytes: %w", err)
}
- _, _, errno := syscall.Syscall(syscall.SYS_TRUNCATE, uintptr(unsafe.Pointer(pathBytes)), 0, 0)
- runtime.KeepAlive(pathBytes)
- if errno == 0 {
- return fmt.Errorf("expected ENOENT, but truncate succeeded")
+ // Retry a few times to make this test resilient under high integration
+ // parallelism where a single failed syscall event can be dropped.
+ for i := 0; i < 5; i++ {
+ _, _, errno := syscall.Syscall(syscall.SYS_TRUNCATE, uintptr(unsafe.Pointer(pathBytes)), 0, 0)
+ runtime.KeepAlive(pathBytes)
+ if errno == 0 {
+ return fmt.Errorf("expected ENOENT, but truncate succeeded")
+ }
}
return nil
}