Skip to content

Stop pytest-timeout from killing Redis Docker image pull - #530

Open
vyrnsynx wants to merge 1 commit into
python-arq:mainfrom
vyrnsynx:fix/ci-redis-pull-timeout-529
Open

Stop pytest-timeout from killing Redis Docker image pull#530
vyrnsynx wants to merge 1 commit into
python-arq:mainfrom
vyrnsynx:fix/ci-redis-pull-timeout-529

Conversation

@vyrnsynx

@vyrnsynx vyrnsynx commented Sep 2, 2026

Copy link
Copy Markdown

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

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>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ee4b48...9dbabab. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

CI flakes on Docker image pull timeout: session-scoped redis_container fixture runs inside the global 10s pytest-timeout

2 participants