[BugFix] Skip TestGatherLayer_Losses on macOS
closes #1917
Description
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'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.skipif for codecov reasons, so this PR adds sys.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
- [x] I have updated the tests.
- [ ] I need help on it.
@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
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 86.23%. Comparing base (7675dda) to head (b78ad7c).
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
The failed CI job died during the dependency install step, not a code/test failure. Re-running the job should suffice.