lightly icon indicating copy to clipboard operation
lightly copied to clipboard

[BugFix] Skip TestGatherLayer_Losses on macOS

Open RecreationalMath opened this issue 6 months ago • 5 comments

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.

RecreationalMath avatar May 07 '26 11:05 RecreationalMath

@liopeer, could you please initiate the test run and review this? Thanks!

RecreationalMath avatar May 19 '26 09:05 RecreationalMath

Thank you for the PR! Sorry for the delay. I'll try to review it this week!

gabrielfruet avatar May 19 '26 15:05 gabrielfruet

/review

gabrielfruet avatar May 19 '26 15:05 gabrielfruet

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.

codecov[bot] avatar May 20 '26 10:05 codecov[bot]

The failed CI job died during the dependency install step, not a code/test failure. Re-running the job should suffice.

RecreationalMath avatar May 20 '26 12:05 RecreationalMath