Add automatic retry mechanism for flaky tests#380
Merged
MaxGhenis merged 18 commits intoPolicyEngine:masterfrom Jul 24, 2025
Merged
Add automatic retry mechanism for flaky tests#380MaxGhenis merged 18 commits intoPolicyEngine:masterfrom
MaxGhenis merged 18 commits intoPolicyEngine:masterfrom
Conversation
- Add pytest-rerunfailures plugin to dependencies - Configure pytest to retry failed tests up to 2 times with 5 second delay - This helps handle intermittent CI failures without manual intervention - Fixes PolicyEngine#379 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #380 +/- ##
==========================================
+ Coverage 80.50% 80.67% +0.17%
==========================================
Files 194 194
Lines 10038 10036 -2
Branches 1058 1057 -1
==========================================
+ Hits 8081 8097 +16
+ Misses 1668 1651 -17
+ Partials 289 288 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Change smoke test job to install policyengine-core without [dev] to get general requirements - This ensures pytest-rerunfailures is available for all test runs - Keep retry flags in Makefile only (not in pytest.ini) to avoid issues with jobs that don't have the plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
4298382 to
c4da58d
Compare
The smoke tests may have conflicts with the plugin, so disable it explicitly for those tests while keeping it enabled for the main test suite. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add pip list command to see what pytest packages are installed to help diagnose the smoke test failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This prevents conflicts when installing policyengine-us in smoke tests while keeping the retry functionality for main test suite. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Python 3.13 appears to have compatibility issues with policyengine-us. Skip these tests until policyengine-us is updated to support 3.13. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Install HDF5 libraries before installing policyengine-us to fix tables package build failures on both Ubuntu and Windows. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Pre-install a newer version of tables that has Python 3.13 wheels to avoid build failures. The old tables==3.9.2 doesn't have 3.13 wheels. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds automatic retry functionality for tests that fail intermittently in CI, addressing issue #379.
Changes
pytest-rerunfailuresplugin to dependenciesBenefits
Test Plan
Fixes #379
🤖 Generated with Claude Code