Stop pytest-timeout from killing Redis Docker image pull - #530
Open
vyrnsynx wants to merge 1 commit into
Open
Conversation
Session-scoped redis_container pulls a Redis Docker image during setup. On a cold cache that pull can exceed the global 10s timeout and pytest-timeout kills the first test mid-pull, cascading into unrelated failures. Set timeout_func_only so only test bodies are timed; keep timeout = 10. Fixes python-arq#529 Co-authored-by: MarkGus0 <MarkGus0@users.noreply.github.com>
3 tasks
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #530 +/- ##
==========================================
- Coverage 96.27% 95.85% -0.43%
==========================================
Files 11 11
Lines 1074 1085 +11
Branches 209 144 -65
==========================================
+ Hits 1034 1040 +6
- Misses 19 24 +5
Partials 21 21 see 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.
CI flakes when the session-scoped redis_container fixture pulls a Redis image under the global 10s pytest-timeout. A cold cache or slow network makes docker.images.pull exceed 10s; pytest-timeout then kills whichever test first triggers the fixture.
pyproject.toml already has timeout = 10. This change sets pytest-timeout timeout_func_only = true so the 10s limit applies only to test function bodies, not fixture setup/teardown. Container image pull and start are therefore outside that budget. Individual tests stay under 10s.
No tests are removed or weakened.
Fixes #529