Use pytest-rerunfailures to avoid tmp_path stashkey issues#5869
Use pytest-rerunfailures to avoid tmp_path stashkey issues#5869adhami3310 merged 1 commit intomainfrom
Conversation
Sadly due to str0zzapreti/pytest-retry#46 having no resolution from upstream.
There was a problem hiding this comment.
Greptile Overview
Summary
This PR switches the test retry mechanism from `pytest-retry` to `pytest-rerunfailures` to resolve stashkey issues in the test suite. The change involves two key modifications:- Dependency Update: In
pyproject.toml, the development dependency is changed frompytest-retrytopytest-rerunfailures - Command Parameter Update: In the integration app harness workflow, the pytest command parameter is updated from
--retries 3to--reruns 3
This change addresses an unresolved upstream issue (str0zzapreti/pytest-retry#46) related to tmp_path stashkey problems in the pytest-retry library. The migration to pytest-rerunfailures provides the same core functionality of retrying failed tests but uses a more maintained and stable implementation.
The change aligns the codebase with existing usage patterns, as other workflow files in the repository were already using the --reruns syntax, suggesting the dependency specification was inconsistent with actual runtime requirements. Both libraries serve the same purpose of improving test reliability by automatically retrying failed tests, so the functionality remains unchanged while resolving the blocking upstream issue.
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| pyproject.toml | 5/5 | Replaced pytest-retry with pytest-rerunfailures in development dependencies |
| .github/workflows/integration_app_harness.yml | 5/5 | Updated pytest command parameter from --retries 3 to --reruns 3 |
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it addresses a known upstream issue with a well-established alternative
- Score reflects a straightforward dependency swap with matching command parameter updates that maintain identical functionality
- No files require special attention as both changes are simple, well-documented replacements
Sequence Diagram
sequenceDiagram
participant User
participant GitHub
participant Runner as "Ubuntu Runner"
participant Redis
participant Playwright
participant Pytest
User->>GitHub: "Push to main or create PR"
GitHub->>Runner: "Trigger integration-app-harness workflow"
Runner->>Runner: "Checkout code"
Runner->>Runner: "Setup Python environment with uv"
alt State manager is redis
Runner->>Redis: "Start Redis service container"
Redis-->>Runner: "Health check: redis-cli ping"
end
Runner->>Playwright: "Install Chromium browser"
Playwright-->>Runner: "Browser ready"
Runner->>Pytest: "Run integration tests with --reruns 3"
loop Test execution with reruns
Pytest->>Runner: "Execute test split group"
alt Test fails
Pytest->>Pytest: "Retry failed test (up to 3 times)"
end
alt Using Redis state manager
Pytest->>Redis: "Connect via redis://localhost:6379"
Redis-->>Pytest: "State management operations"
end
end
Pytest-->>Runner: "Test results"
Runner-->>GitHub: "Report workflow status"
GitHub-->>User: "Display test results"
2 files reviewed, no comments
CodSpeed Performance ReportMerging #5869 will not alter performanceComparing Summary
|
Sadly due to str0zzapreti/pytest-retry#46 having no resolution from upstream.
Had at least one rerun in this CI run https://github.com/reflex-dev/reflex/actions/runs/18383346259/job/52375408227