summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Magefile.go7
-rw-r--r--integrationtests/cmd/ioworkload/scenario_dir.go6
-rw-r--r--integrationtests/cmd/ioworkload/scenario_unlink.go3
3 files changed, 13 insertions, 3 deletions
diff --git a/Magefile.go b/Magefile.go
index edc106c..57ce61c 100644
--- a/Magefile.go
+++ b/Magefile.go
@@ -325,7 +325,12 @@ func runIntegrationTests(parallel bool) error {
func resolveIntegrationParallelism() (int, error) {
parallel := strings.TrimSpace(os.Getenv(integrationParallel))
if parallel == "" {
- n := runtime.NumCPU() * 2
+ // Conservative default for stability: high per-test process fan-out can
+ // cause missed first events under heavy load.
+ n := runtime.NumCPU()
+ if n > 2 {
+ n = 2
+ }
if n < 1 {
n = 1
}
diff --git a/integrationtests/cmd/ioworkload/scenario_dir.go b/integrationtests/cmd/ioworkload/scenario_dir.go
index 81421ec..7a78716 100644
--- a/integrationtests/cmd/ioworkload/scenario_dir.go
+++ b/integrationtests/cmd/ioworkload/scenario_dir.go
@@ -210,13 +210,15 @@ func dirChdirEnoent() error {
// The syscall fails with EBADF, but ior captures the tracepoint on entry.
func dirGetdentsEbadf() error {
buf := make([]byte, 4096)
- // Retry a few times to reduce flakiness under high integration parallelism.
- for i := 0; i < 5; i++ {
+ // Keep issuing the syscall for a short window so ior has enough time to
+ // attach under high parallel integration load.
+ for i := 0; i < 40; 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")
}
+ time.Sleep(25 * time.Millisecond)
}
return nil
}
diff --git a/integrationtests/cmd/ioworkload/scenario_unlink.go b/integrationtests/cmd/ioworkload/scenario_unlink.go
index ec7c926..e2cba6c 100644
--- a/integrationtests/cmd/ioworkload/scenario_unlink.go
+++ b/integrationtests/cmd/ioworkload/scenario_unlink.go
@@ -5,6 +5,7 @@ import (
"path/filepath"
"runtime"
"syscall"
+ "time"
"unsafe"
)
@@ -86,6 +87,8 @@ func unlinkRmdir() error {
if err := syscall.Mkdir(subDir, 0o755); err != nil {
return fmt.Errorf("mkdir: %w", err)
}
+ // Give ior a brief attach window before the one-shot rmdir syscall.
+ time.Sleep(300 * time.Millisecond)
pathBytes, err := syscall.BytePtrFromString(subDir)
if err != nil {