[BugFix] Skip TestGatherLayer_Losses on macOS#1922
Conversation
TestGatherLayer_Losses uses DDPStrategy(devices=2) under pytest. On macOS, the spawn start method causes the DDP worker child to re-import the test module and block on pytest fixture machinery, while the parent waits for the child to join the DDP process group. The result is make test-fast hanging indefinitely with no output. The same class is already skipped on GitHub Actions for codecov reasons. Adding macOS to the existing condition removes the local hang without changing CI coverage
|
@liopeer, could you please initiate the test run and review this? Thanks! |
|
Thank you for the PR! Sorry for the delay. I'll try to review it this week! |
|
/review |
There was a problem hiding this comment.
Pull request overview
This PR prevents a macOS-only hang in the test suite by extending an existing skip condition for TestGatherLayer_Losses to also skip on sys.platform == "darwin", matching the issue’s described DDP spawn/pytest interaction deadlock.
Changes:
- Add
sysimport for platform detection. - Expand
pytest.mark.skipifcondition to skip on macOS in addition to GitHub Actions. - Update the skip reason message to document both skip causes (codecov on GHA, DDP spawn deadlock on macOS).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1922 +/- ##
=======================================
Coverage 86.23% 86.23%
=======================================
Files 169 169
Lines 7105 7105
=======================================
Hits 6127 6127
Misses 978 978 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The failed CI job died during the dependency install step, not a code/test failure. |
closes #1917
Description
TestGatherLayer_LossesusesDDPStrategy(devices=2)under pytest. On macOS the spawn start method causes the DDP worker child to re-import the test module and block on pytest's fixture machinery, while the parent waits for the child to join the DDP process group. The suite hangs indefinitely with no error.The same class is already skipped on GitHub Actions via
pytest.mark.skipiffor codecov reasons, so this PR addssys.platform == "darwin"to that condition. Empirical reproduction (~40 runs) and root-cause analysis are in the issue thread.Manual verification on macOS 26.4.1 (arm64):
pytest tests/utils/test_dist__gather__losses.py -v: 4 skipped, no hang (5.8s).make test-fast: 1560 passed, 258 skipped, no hang (3:30).make format: ruff clean.No documentation changes required: this is a test-file skip-condition adjustment with no public API or docs surface.
Tests