Test interrupted artifact downloads without publishing files (CLS-1203) #304

Merged
stephen merged 3 commits from stephen/cls-1203-download-length-check into main 2026-11-09 21:54:17 +00:00
Owner

CLS-1203. #298 already makes fj compare the body with Content-Length, retry short or broken bodies, and install atomically, and it tests a short Content-Length body. What was not covered is a connection reset in the middle of the body.

This adds a Unix-only regression test: the server sends headers and a partial body, then closes abortively (SO_LINGER 0, so the client sees a reset). It goes through api::workflow::download_artifact and download::write_atomic, and checks that:

  • the download fails after 3 attempts with the expected size in the error
  • the destination does not exist
  • no temporary file is left in the directory

No production code changes.

Failure paths: 2 (retries exhaust and fail, nothing is recorded as done), 4 (a transport error is an error, not a short success), 13 (the test uses a real socket reset, not a mock). Other checklist items: n/a, test only.

Tests: cargo test --bin fj reset_mid_stream_exhausts_retries_without_publishing_artifact and artifact_content_length_mismatch_retries_then_fails_without_file pass locally.

CLS-1203. #298 already makes `fj` compare the body with Content-Length, retry short or broken bodies, and install atomically, and it tests a short Content-Length body. What was not covered is a connection reset in the middle of the body. This adds a Unix-only regression test: the server sends headers and a partial body, then closes abortively (SO_LINGER 0, so the client sees a reset). It goes through `api::workflow::download_artifact` and `download::write_atomic`, and checks that: - the download fails after 3 attempts with the expected size in the error - the destination does not exist - no temporary file is left in the directory No production code changes. Failure paths: 2 (retries exhaust and fail, nothing is recorded as done), 4 (a transport error is an error, not a short success), 13 (the test uses a real socket reset, not a mock). Other checklist items: n/a, test only. Tests: `cargo test --bin fj reset_mid_stream_exhausts_retries_without_publishing_artifact` and `artifact_content_length_mismatch_retries_then_fails_without_file` pass locally.
Test interrupted artifact downloads without publishing files
Some checks failed
ci / check (pull_request) Failing after 2m55s
ci / coverage (pull_request) Has been skipped
ci / live-e2e (pull_request) Has been skipped
ec75e721df
Add a regression that resets the TCP connection mid-body and checks the
download fails after all retries with no destination or temp file left.
gerri approved these changes 2026-11-08 03:32:24 +00:00
gerri left a comment

Automated Codex review (read-only) of head ec75e721df.

No actionable findings against the diff or STANDARDS.md. Tests were not run in the read-only sandbox.

BLOCKING: 0

Reviewed head ec75e721df at 2026-11-08T03:32:23Z by codex exec (read-only sandbox).

Automated Codex review (read-only) of head ec75e721dfce95256453d363377247fce04a057b. No actionable findings against the diff or STANDARDS.md. Tests were not run in the read-only sandbox. BLOCKING: 0 --- Reviewed head ec75e721dfce95256453d363377247fce04a057b at 2026-11-08T03:32:23Z by codex exec (read-only sandbox).
Exclude the artifact transfer test module from coverage like the other test modules
Some checks failed
ci / check (pull_request) Failing after 8m59s
ci / coverage (pull_request) Has been skipped
ci / live-e2e (pull_request) Has been skipped
e311f9a7db
Update fjord-core to 0.1.6 for the SQLite security fix (RUSTSEC-2026-0459)
All checks were successful
ci / check (pull_request) Successful in 22m44s
ci / coverage (pull_request) Successful in 2m45s
ci / live-e2e (pull_request) Successful in 4m33s
c3eac7954c
stephen deleted branch stephen/cls-1203-download-length-check 2026-11-09 21:54:17 +00:00
Sign in to join this conversation.
No description provided.