Fix Pipenv matrix flake on 503/DNS transport blips - #419
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 1, 2026
Merged
Conversation
The Pipenv compatibility matrix downloads real wheels from PyPI and
talks to the public patch service, but unlike the Bun, PDM and vlt
harnesses it had no transport retry. A single PyPI 503 burst ("too
many 503 error responses") turned a whole matrix leg red, and the
run had to be re-run by hand: 15 failed legs across 10 runs in the
last two weeks went green on re-run of the same commit.
Re-run a failed case from a fresh case directory, at most three
attempts, only when its error text or logs show a transport error
(pip giving up on PyPI, connection errors, a CLI request error or a
patch API 5xx). Functional failures are never retried. Earlier
attempts' logs are kept under attempts/ and listed on the row.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TrR5uqMbj9sJcU2Gpm9y9R
Collaborator
Author
|
bugbot run Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TrR5uqMbj9sJcU2Gpm9y9R
Collaborator
Author
|
bugbot run Generated by Claude Code |
Collaborator
Author
|
[burn-down agent] Ready for review on
Generated by Claude Code |
Wenxin Jiang (Wenxin-Jiang)
approved these changes
Oct 1, 2026
Collaborator
Author
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit acbce34. Configure here.
Mikola Lysenko (mikolalysenko)
deleted the
ci-janitor/pipenv-network-retry
branch
October 1, 2026 16:48
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.
Problem
Pipenv compatibilityis the flakiest PR workflow by re-run count. Between 2026-09-18 and 2026-10-01, 10 runs went red on attempt 1 and green on re-run of the same SHA, covering 15 failed matrix legs (9 on the 8-release ubuntudirectleg, 3 on the macOS leg, 3 on the ubuntucrlf/marker-excluded/extras/categoryleg). Each re-run costs a full matrix leg (5–7 min each, on top of the cargo build) plus a human noticing and re-running it.Examples of red-then-green runs:
Clustering the attempt-1 logs of all 15 legs:
Max retries exceeded ... /patch/pypi/urllib3/1.26.18/... (Caused by ResponseError('too many 503 error responses'))(pip fetching the hosted patch wheel)NewConnectionError ... [Errno 8] nodename nor servname providedwarmInstallReplacesUpstreamplus one lock-only/dry-run check, withlock-only applied=0and no exception text in the summary tableSystemExit: 1, root cause truncatedrescanIdempotent/scanAppliedExample (job 109834889963):
Root cause (confirmed cluster)
scripts/backtest-pipenv.pyinstalls real wheels, both from PyPI and from the public patch service's hosted wheel URLs. Unlike the Bun (retry_network_cell), PDM (NETWORK_RE+Run(retry=True)) and vlt (run_with_retries) harnesses, it has no transport retry. One 503 burst or DNS blip fails the case, so the leg exits 1.The
applied=0cluster looks like the same outage reaching the CLI's hosted fetch, but the summary table hides the CLI's output. The case logs are not uploaded as an artifact; onlysummary.*is. The retry recorded here (transportRetries) will show insummary.jsonwhether those rows were transport failures. The other two clusters are left for a follow-up.Fix
retry_transportwraps each case in the scheduler. When a case raises or fails its checks and its error text or one of its*.log*files matches a narrow transport signature, it re-runs the case from a fresh case directory, with at most 3 attempts and a 10s/20s backoff.backtest_casealreadyrmtrees the case dir, and the shared native lock is only cached afterpipenv locksucceeds. Signatures: pip'stoo many 5xx error responses/Max retries exceeded with url/NewConnectionError/ConnectTimeoutError/ReadTimeoutError/ DNS (Temporary failure in name resolution, macOSnodename nor servname provided) / connection reset, plus the CLI's ownerror sending request for url (/API request failed with status 5xx(the same regex the Bun and vlt harnesses use).attempts/<case>/<n>/, and the final row recordstransportRetries, so a retried pass shows up insummary.json.case_dirwas factored out so the scheduler and the case runner agree on the path.No assertions were weakened and no tests were removed or moved. The workflow and job names are unchanged.
Proof
PipenvTransportRetryTestsinscripts/tests/test_backtest_harnesses.py, run by the workflow's "Harness unit tests" step):python3 -B -m unittest scripts/tests/test_backtest_harnesses.py: 59 tests OK (re-run after merging main atacbce34).ruff check: same 4 errors as on main, none new.mainwas merged in atacbce34because Fix Poetry venv discovery to match Poetry (#327, #329) #330 changedpython_crawler.rsvenv discovery, which the Pipenv matrix exercises. CI is re-running on that head.Where tests run
The tests are unchanged. The Pipenv matrix still runs on PRs that touch its paths and on every push to main.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TrR5uqMbj9sJcU2Gpm9y9R