test(libc): keep macOS write watch stress bounded #2846
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2846"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T16:29:52Z.
What
Keep the macOS write-watch thread stress test below the 30-second CI limit. The test polls and recollects all watched pages in a tight loop while four writer threads run. Reduce the stress loop from 200 rounds to 50 and yield between collections so the writers can make progress under contention. The four writers, concurrent collection, and final-write assertions remain covered.
This is a follow-up to the unrelated timeout seen in #2819. The same
write_watch_threadstimeout also appeared in another PR run, while the corresponding macOS arm64 job passed.Tested
python3 tools/check_conventions.py --base upstream/mainpassed.git diff --checkpassed.Checklist
main; no open PR implements this test adjustmentImported from boykopovar/AnyPS5. Originally posted by Bruggi-ch on 2026-10-10T20:17:12Z.
Measured on a MacBook Air, Apple M5 (10 cores, on AC power), macOS 27.0.1, x86-64 under Rosetta, built as in BUILD.md ("Write watch tests",
-DCMAKE_OSX_ARCHITECTURES=x86_64).mainat1476f769against this PR atf907365f. I ranwrite_watch_tests threadsdirectly, 20 runs per variant, alternating.Without load:
main: median 6.78 s, range 4.02 to 10.58 s, 0 failed.With 10 busy
yesprocesses (one per core):main: 12 of 20 runs reached my 60 s cutoff, the fastest took 39.04 s. Every run exceeded 30 s.All five write watch tests pass with the PR (
ctest, 0.33 s). The PR changes both the round count and addsyield(); I did not measure them separately. One PR run under load took 0.02 s and I could not explain it. The load is artificial and the 60 s is my own cutoff, not the true duration onmain.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T20:19:49Z.
Thanks for measuring both versions on the same Mac and reporting the loaded and unloaded runs. The large reduction in runtime supports the change; I agree the
yesworkload is an artificial stress case, so I’ll treat those figures as evidence of worst-case headroom rather than typical runtime.I rebased the PR onto current
main. The earlier macOS CI run passed, and this update will trigger a fresh run against the current base.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:58:47Z.
Checked the diff (rounds 200 → 50,
yield()between collections; the four writers, concurrentCollectand the final== Roundsassertion are kept). macOS write-watch jobs (macos-15, macos-15-intel) are green on this head, and @Bruggi-ch's measurements on Apple M5 show 6.78 s → 0.26 s unloaded and no more 30 s timeouts under load. Merging.