Skip to content

test: retry the flaky cancel-with-discard integration test - #21

Merged
Xander-git merged 1 commit into
feature/gui-imrprovement-v2from
fix/flaky-cancel-discard-test
May 30, 2026
Merged

Xander-git merged 1 commit into
feature/gui-imrprovement-v2from
fix/flaky-cancel-discard-test

Conversation

@Xander-git

Copy link
Copy Markdown
Collaborator

Summary

test_cancel_with_discard_files_removes_partial_dir races the creation pipeline against a mid-flight cancel (polls with asyncio.sleep, branches on whether the dir landed first). Under load the race can transiently lose, flaking the suite — it failed once during the #20 verification run, then passed in isolation and on re-run.

Change

  • Add pytest-rerunfailures to the test extra.
  • Mark the test @pytest.mark.flaky(reruns=3, reruns_delay=0.5) so a transient timing miss retries instead of failing CI.

Verification

  • The real test passes with the marker.
  • Confirmed the retry mechanism engages: a throwaway test that fails twice then passes on the 3rd attempt reports 1 passed, 2 rerun.
  • ruff clean on the changed test file.

🤖 Generated with Claude Code

`test_cancel_with_discard_files_removes_partial_dir` races the creation
pipeline against a mid-flight cancel (it polls with asyncio.sleep and
branches on whether the directory landed first). Under load the race can
transiently lose, flaking the suite.

Add pytest-rerunfailures to the test extra and mark the test
`@pytest.mark.flaky(reruns=3, reruns_delay=0.5)` so a transient timing miss
retries instead of failing CI. Verified the marker re-runs on failure
(fails twice -> passes on the third attempt).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Xander-git
Xander-git merged commit 358c7ff into feature/gui-imrprovement-v2 May 30, 2026
3 checks passed
@Xander-git
Xander-git deleted the fix/flaky-cancel-discard-test branch May 30, 2026 07:15
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.

1 participant