Skip to content

Use pytest-rerunfailures to avoid tmp_path stashkey issues#5869

Merged
adhami3310 merged 1 commit intomainfrom
masenf/rerunfailures
Oct 9, 2025
Merged

Use pytest-rerunfailures to avoid tmp_path stashkey issues#5869
adhami3310 merged 1 commit intomainfrom
masenf/rerunfailures

Conversation

@masenf
Copy link
Collaborator

@masenf masenf commented Oct 9, 2025

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

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

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:
  1. Dependency Update: In pyproject.toml, the development dependency is changed from pytest-retry to pytest-rerunfailures
  2. Command Parameter Update: In the integration app harness workflow, the pytest command parameter is updated from --retries 3 to --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"
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 9, 2025

CodSpeed Performance Report

Merging #5869 will not alter performance

Comparing masenf/rerunfailures (749603e) with main (5d0ddff)

Summary

✅ 8 untouched

@adhami3310 adhami3310 merged commit 7bf8413 into main Oct 9, 2025
47 checks passed
@adhami3310 adhami3310 deleted the masenf/rerunfailures branch October 9, 2025 17:21
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.

2 participants