Repository navigation
Fail only the faulted file when an HTTP transfer breaks, and port the chaos tests - #63
Merged
denniswu28 merged 3 commits intoOct 28, 2026
Conversation
Since e2c1e61 the HTTP backend reads response.raw directly, which bypasses Requests' error wrapping: a reset, truncated or stalled body raised a urllib3 ProtocolError or ReadTimeoutError. Neither is a RequestException, so the error escaped fetch, _run_transfers treated it as an interrupt that cancelled every other transfer, and the CLI printed a traceback. Catch urllib3's errors in fetch and report them as the usual per-file DownloadError; the CLI's user-error list gets the same types as a backstop. Port the fault-injecting loopback server, the chaos helpers and the network fault tests from ci/test-automation so this stays covered: 29 tests over real sockets, including the former #54 xfail, which now passes. Counts are taken from the download plan because a published manifest is catalogued and fetched as well. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The fault-injection suite that found #53 to #58 lived only on ci/test-automation and had drifted from the code. Bring over the helpers, the kill-at-a-point child process, and the three test modules under the chaos marker, adapted to the current layout: branches are created with hm branch before checkout, partial downloads live in .hm/objects/tmp (now counted as debris after a finished operation), download counts come from the plan because a published manifest is catalogued too, and the storage tests use distinct file names so one temporary file can be targeted. The former #58 xfail passes and becomes a regression test; #55, #56 and #57 keep strict xfails so their fixes flip them. The nightly workflow reruns the suite with fresh seeds and more steps from the default branch, and on pull requests that touch it. Locally: 50 passed and 5 xfailed in 38 s; both monkeys hold for three seeds at 150 steps. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
urllib3 1.x, which requests 2.26 still installs, does not check a body against its Content-Length unless asked: a connection closed early simply ends the body. On the lowest-dependencies CI job a checksum manifest cut off after five bytes was read as a manifest with no entries, so a rescan succeeded and silently dropped every published checksum; a download with no known size or checksum would likewise have stored a truncated file. urllib3 2 refuses such a body by default. HttpBackend now sets enforce_content_length on each urllib3 response it opens, for file transfers and for metadata (listings, manifests, catalogue files and WebDAV PROPFIND), so a short body fails as it does on urllib3 2. Responses that are not urllib3's, as test doubles are, are left alone. A manifest that ends cleanly but early joins the rescan faults. Locally: full suite with SSH tests on Python 3.9 with the oldest allowed dependencies (requests 2.26.0, urllib3 1.26.20) 1547 passed, 4 skipped, 5 xfailed; on Python 3.13 with current ones 1548 passed, 3 skipped, 5 xfailed; without this change both manifest faults fail on the oldest dependencies; ruff clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
denniswu28
merged commit Oct 28, 2026
c66e57b
into
codex/function-atomic-replay-20260928
22 checks passed
This was referenced Oct 30, 2026
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.
Two commits:
response.rawdirectly, so a reset, truncated or stalled body raised a urllib3 error. That error escapedfetch, cancelled every other transfer and printed a traceback. It is now a per-fileDownloadError. The fault-injecting loopback server and 29 network fault tests come over fromci/test-automation; the former Truncated download accepted when the catalog records a size but no checksum #54 xfail passes.chaosmarker and adapted to the current layout. The former Checkout before the first commit shows a raw Git error #58 xfail passes and becomes a regression test. A failed add can leave config.yml, meta.yml and data.tsv from different states #55, A checkout interrupted partway cannot be rerun #56 and add_worktree rerun after an interruption leaves the worktree without files #57 keep strict xfails; the follow-up PR fromfix/open-issuesfixes them and drops the xfails. A nightly workflow reruns the suite with fresh seeds.Locally, the full suite with SSH tests gives 1547 passed, 3 skipped and 5 xfailed; the xfails are the strict ones for #55–#57. Ruff is clean.
🤖 Generated with Claude Code