diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-13 12:26:44 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-13 12:26:44 +0200 |
| commit | 0d4354bab36c95cd4e8125d2d7b5b66de4ae5d11 (patch) | |
| tree | 0989e1c43610588501eea80589678546a9b30fe1 /integrationtests/cmd/ioworkload/scenario_fcntl.go | |
| parent | 14c15ff8387f5829a2afde5a0792d2e254a452aa (diff) | |
test: stabilize integration error-path workloads
Diffstat (limited to 'integrationtests/cmd/ioworkload/scenario_fcntl.go')
| -rw-r--r-- | integrationtests/cmd/ioworkload/scenario_fcntl.go | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/integrationtests/cmd/ioworkload/scenario_fcntl.go b/integrationtests/cmd/ioworkload/scenario_fcntl.go index 0d8e642..0c97002 100644 --- a/integrationtests/cmd/ioworkload/scenario_fcntl.go +++ b/integrationtests/cmd/ioworkload/scenario_fcntl.go @@ -96,9 +96,11 @@ func fcntlDupfdCloexec() error { // The syscall fails with EBADF, but ior should capture the enter_fcntl // tracepoint because it is recorded on syscall entry. func fcntlInvalidFd() error { - _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, 99999, syscall.F_GETFL, 0) - if errno == 0 { - return fmt.Errorf("expected fcntl on invalid fd to fail") + for i := 0; i < 5; i++ { + _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, 99999, syscall.F_GETFL, 0) + if errno == 0 { + return fmt.Errorf("expected fcntl on invalid fd to fail") + } } return nil } @@ -120,10 +122,13 @@ func fcntlDupfdMax() error { } defer syscall.Close(fd) - // Use a minfd far beyond any realistic RLIMIT_NOFILE. - _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), syscall.F_DUPFD, 1<<30) - if errno == 0 { - return fmt.Errorf("expected fcntl F_DUPFD with extreme minfd to fail") + // Retry the failing fcntl a few times to avoid a single one-shot call + // racing early trace capture under parallel integration load. + for i := 0; i < 5; i++ { + _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), syscall.F_DUPFD, 1<<30) + if errno == 0 { + return fmt.Errorf("expected fcntl F_DUPFD with extreme minfd to fail") + } } return nil } |
