Skip to content

Fail only the faulted file when an HTTP transfer breaks, and port the chaos tests - #63

Merged
denniswu28 merged 3 commits into
codex/function-atomic-replay-20260928from
fix/http-fault-errors
Oct 28, 2026
Merged

denniswu28 merged 3 commits into
codex/function-atomic-replay-20260928from
fix/http-fault-errors

Conversation

@denniswu28

Copy link
Copy Markdown

Two commits:

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

denniswu28 and others added 2 commits October 26, 2026 02:52
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-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.

📢 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
denniswu28 merged commit c66e57b into codex/function-atomic-replay-20260928 Oct 28, 2026
22 checks passed
@denniswu28
denniswu28 deleted the fix/http-fault-errors branch October 30, 2026 03:05
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.

2 participants