Skip to content

Conversation

@bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented Jan 7, 2026

What does this PR do?

Fixes flaky test failures that were occurring inconsistently across different platforms and Python versions in CI. Currently can be seen in main branch.

image

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84%. Comparing base (21f7686) to head (3cf941b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #649   +/-   ##
===================================
- Coverage    85%    84%   -1%     
===================================
  Files        39     39           
  Lines      3212   3212           
===================================
- Hits       2721   2702   -19     
- Misses      491    510   +19     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bhimrazy bhimrazy changed the title fix: flaky tests fix: Resolve flaky tests across platforms and Python versions Jan 7, 2026
@bhimrazy bhimrazy marked this pull request as ready for review January 7, 2026 08:00
Copilot AI review requested due to automatic review settings January 7, 2026 08:00
@bhimrazy bhimrazy changed the title fix: Resolve flaky tests across platforms and Python versions fix: resolve flaky tests across platforms and Python versions, appearing on main branch Jan 7, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses flaky test failures occurring inconsistently across different platforms and Python versions in the CI pipeline. The changes focus on improving test reliability through better async event loop handling, platform-specific timing adjustments, and CI workflow optimization.

  • Migrates from asyncio.get_event_loop().run_until_complete() to asyncio.run() for better cross-platform event loop handling
  • Adds platform-specific timeout adjustments for macOS to account for slower process spawning
  • Increases batch timeout values to accommodate varying platform performance
  • Optimizes CI workflow to only cancel in-progress runs for pull requests

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/unit/test_loops.py Replaces deprecated event loop pattern with asyncio.run() for async method calls in synchronous test functions
tests/unit/test_lit_server.py Increases worker restart wait time from 2 to 5 seconds on macOS with explanatory comment
tests/unit/test_batch.py Increases batch timeout test parameter from 0.1 to 0.5 seconds for improved stability
.github/workflows/ci-testing.yml Makes cancel-in-progress conditional, only applying to pull request events

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andyland andyland merged commit d244f2c into Lightning-AI:main Jan 7, 2026
34 checks passed
@bhimrazy bhimrazy deleted the fix/flaky-tests branch January 7, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants