From c58ef78b4a79a5cbc9531a74c6e3965ea4c00bc2 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 23 Feb 2026 21:57:35 +0200 Subject: Harden integration workloads against dropped event flakes --- integrationtests/cmd/ioworkload/scenario_unlink.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'integrationtests/cmd/ioworkload/scenario_unlink.go') 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 } -- cgit v1.2.3