Skip to content

test: add interop tests for --partial mid-transfer kill retention - #5398

Merged
oferchen merged 2 commits into
masterfrom
test/pir-6a-partial-mid-transfer-kill
Jun 3, 2026
Merged

oferchen merged 2 commits into
masterfrom
test/pir-6a-partial-mid-transfer-kill

Conversation

@oferchen

@oferchen oferchen commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add 4 integration tests in crates/core/tests/partial_mid_transfer_kill.rs verifying --partial file retention when a daemon transfer is interrupted mid-stream via SIGTERM
  • Tests cover --partial (retains at destination), no --partial (cleans up temp), --partial-dir (retains in designated directory), and upstream rsync 3.4.1 client interop
  • Uses --bwlimit=8 to slow a 2 MB transfer, creating a reliable kill window for SIGTERM to trigger cooperative shutdown and partial retention

Test plan

  • CI fmt+clippy passes (no unsafe code policy issues - test files are separate compilation targets)
  • CI nextest passes (tests are #[ignore] so they compile but don't run without the binary)
  • Tests are #[cfg(unix)] gated since they use SIGTERM via libc::kill
  • All tests are #[ignore = "requires oc-rsync binary"] - they require the binary to be built first
  • The upstream interop test additionally requires target/interop/upstream-install/3.4.1/bin/rsync

Closes PIR-6.a (#3464)

)

Add integration tests verifying that --partial retains partially-received
files when a daemon transfer is interrupted mid-stream via SIGTERM.

Tests cover four scenarios:
- --partial flag retains partial file at destination on kill
- No --partial flag cleans up temp files on kill (control test)
- --partial-dir retains partial file in designated directory on kill
- Upstream rsync 3.4.1 client with --partial against oc-rsync daemon

Uses --bwlimit=8 (8 KB/s) to create a reliable kill window for the 2 MB
test file. SIGTERM triggers cooperative shutdown so the disk commit thread
can execute retain_partial_file() before exiting.

Upstream reference: cleanup.c:105-135, receiver.c:340-345

Closes PIR-6.a (#3464)
@github-actions github-actions Bot added the test label Jun 3, 2026
@oferchen
oferchen merged commit 423e56e into master Jun 3, 2026
118 of 120 checks passed
@oferchen
oferchen deleted the test/pir-6a-partial-mid-transfer-kill branch June 3, 2026 19:10
oferchen added a commit that referenced this pull request Aug 24, 2026
)

* test: add interop tests for --partial mid-transfer kill retention (#3464)

Add integration tests verifying that --partial retains partially-received
files when a daemon transfer is interrupted mid-stream via SIGTERM.

Tests cover four scenarios:
- --partial flag retains partial file at destination on kill
- No --partial flag cleans up temp files on kill (control test)
- --partial-dir retains partial file in designated directory on kill
- Upstream rsync 3.4.1 client with --partial against oc-rsync daemon

Uses --bwlimit=8 (8 KB/s) to create a reliable kill window for the 2 MB
test file. SIGTERM triggers cooperative shutdown so the disk commit thread
can execute retain_partial_file() before exiting.

Upstream reference: cleanup.c:105-135, receiver.c:340-345

Closes PIR-6.a (#3464)

* style: apply cargo fmt formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant