Conversation
Co-authored-by: link89 <3314130+link89@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a default timeout configuration for pytest to prevent tests from hanging indefinitely and blocking CI/CD workflows. The change addresses a specific issue where broken tests could cause workflows to pend for extended periods.
Changes:
- Added
pytest-timeoutdependency to the test dependencies - Configured a default timeout of 1800 seconds (30 minutes) for all pytest tests
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughAdded pytest-timeout plugin as a test dependency and configured a global pytest timeout of 1800 seconds in the project configuration. These changes enable timeout enforcement for test execution across the test suite. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pyproject.toml (1)
458-458: Consider settingtimeout_method = "thread"for harder CI-stall prevention.If the intent is to reliably stop hangs in native/CUDA paths, explicitly using
threadis usually more robust than default signal-based interruption.♻️ Proposed update
[tool.pytest.ini_options] markers = "run" timeout = 1800 +timeout_method = "thread"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pyproject.toml` at line 458, The CI timeout is set via timeout = 1800 but lacks an explicit timeout_method; update pyproject.toml to add timeout_method = "thread" alongside the existing timeout setting to ensure hangs in native/CUDA code are interrupted reliably (modify the same section that contains the timeout = 1800 entry to include timeout_method = "thread").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pyproject.toml`:
- Line 458: The CI timeout is set via timeout = 1800 but lacks an explicit
timeout_method; update pyproject.toml to add timeout_method = "thread" alongside
the existing timeout setting to ensure hangs in native/CUDA code are interrupted
reliably (modify the same section that contains the timeout = 1800 entry to
include timeout_method = "thread").
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5265 +/- ##
=======================================
Coverage 82.00% 82.00%
=======================================
Files 750 750
Lines 75082 75082
Branches 3615 3616 +1
=======================================
Hits 61571 61571
Misses 12347 12347
Partials 1164 1164 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Avoid wasting time on broken test that pending the workflow for a long time like this: https://github.com/deepmodeling/deepmd-kit/actions/runs/22224311896
Summary by CodeRabbit