Repository navigation
[MOD-16323] Fix flaky macOS x86_64 coordinator tests by capping pytest parallelism - #10499
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10499 +/- ##
==========================================
- Coverage 82.87% 82.22% -0.65%
==========================================
Files 606 632 +26
Lines 80392 82134 +1742
Branches 35425 37382 +1957
==========================================
+ Hits 66627 67538 +911
- Misses 13430 14250 +820
- Partials 335 346 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4da32a0 to
7dc9f2b
Compare
…'macos-26-large'" This reverts commit bbecac5.
7dc9f2b to
5316d00
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 687db6722d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
| # macOS 26 (the version on the frequent CI gates); other macOS versions | ||
| # are run rarely and pass today. | ||
| if [[ $REDIS_STANDALONE == 0 && "$(uname -s)" == Darwin && "$(uname -m)" == x86_64 ]] && | ||
| [[ "$(sw_vers -productVersion 2>/dev/null | cut -d. -f1)" == 26 ]]; then |
There was a problem hiding this comment.
Non-blocking suggestion:
The sw_vers == 26 guard works for the current failing lane, but it encodes the runner version rather than the resource constraint causing the flake. We could make this age a bit better by capping macOS x86_64 coordinator runs to the physical CPU count when that is lower than nproc:
parallel="$(nproc)"
if [[ $REDIS_STANDALONE == 0 && "$(uname -s)" == Darwin && "$(uname -m)" == x86_64 ]]; then
physical_cores="$(sysctl -n hw.physicalcpu 2>/dev/null)"
if [[ $physical_cores =~ ^[0-9]+$ && $physical_cores -gt 0 && $parallel -gt $physical_cores ]]; then
parallel=$physical_cores
fi
fiThis keeps the existing default behavior, and applies only when the detected physical core count confirms that logical-core parallelism would overdrive the coordinator run.
|
/backport-agent 8.10 8.8 8.6 8.8-rse 8.6-rse |



Description
Current:
Heavy coordinator (cluster-mode) pytests are flaky only on the macOS 26 x86_64 CI runner. That runner is a VM on an old 6-core (12-logical) Intel Mac, and pytest runs nproc = 12 workers. In cluster mode each worker spawns its own SHARDS-shard cluster, so 12 workers = 36 redis processes on 6 physical cores. The oversubscription produced two symptoms: per-test timeouts (e.g. testSynonymsIntensiveLoad exceeding the budget) and ephemeral-port exhaustion (OSError: [Errno 49] bursts across unrelated tests). As a stopgap, the macOS x86_64 test runners had been excluded from the frequent CI gates.
Change:
tests/pytests/runtests.sh, when using the default (nproc) worker count on a macOS 26 x86_64 host and in coordinator mode (REDIS_STANDALONE == 0), cap workers tovirtual_cores / 2(12 / 2 = 6), matching the worker count to the 6 physical cores so oversubscription is bounded instead of scaled by the logical-CPU count. Standalone runs one redis per worker and is unaffected — it keeps the nproc default./SHARDS= 4-worker variant was also green but ~8m slowerWhich additional issues this PR fixes
Main objects this PR modified
tests/pytests/runtests.sh— coordinator-only, shard-aware parallelism cap for macOS 26 x86_64Mark if applicable
Release Notes
CI/test-infrastructure change only — no user-facing behavior change.