test: retry the flaky cancel-with-discard integration test - #21
Merged
Xander-git merged 1 commit intoMay 30, 2026
Merged
Conversation
`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>
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
test_cancel_with_discard_files_removes_partial_dirraces the creation pipeline against a mid-flight cancel (polls withasyncio.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
pytest-rerunfailuresto thetestextra.@pytest.mark.flaky(reruns=3, reruns_delay=0.5)so a transient timing miss retries instead of failing CI.Verification
1 passed, 2 rerun.ruffclean on the changed test file.🤖 Generated with Claude Code