Repository navigation
test(protocol): lock daemon-sender goodbye NDX_DONE contract - #5600
Merged
Merged
Conversation
Locks in the daemon-sender goodbye-phase wire contract via three complementary tests in crates/protocol/tests/goodbye_contract.rs: - EDG-GOODBYE.1: golden bytes for plain push, push + --delete, and the compression-is-orthogonal invariant on protocol 28-32. Goldens are built in-process via the same codec primitives the production generator uses, so the test is deterministic and self-contained. - EDG-GOODBYE.2: 100-iteration stress loop that rotates through five scenarios and asserts zero drops of the final NDX_DONE sentinel through an emit/parse round-trip. Mirrors UTS-9.REOPEN / UTS-15.c failure mode at codec scope (full-daemon stress is left to those tasks). - EDG-GOODBYE.3: proptest covering (protocol in 28..=32, delete-flag, arbitrary DeleteStats) - last protocol-frame must always be NDX_DONE with no trailing bytes; NDX_DEL_STATS is always followed by exactly five varints + NDX_DONE; protocol < 31 never emits NDX_DEL_STATS. Adds docs/audits/edg-goodbye-contract.md describing the wire contract and pointing UTS-9.REOPEN and UTS-15.c at the machine-checked invariant they can rely on.
Locks the receiver-side half of the EDG-GOODBYE contract. While EDG-GOODBYE.1/.2/.3 in crates/protocol/tests/goodbye_contract.rs pin the wire shape the sender must emit, EDG-GOODBYE.4 pins what the receiver must do when the sender misbehaves. Eight scenarios are covered by tests in crates/transfer/src/receiver/tests/errors_and_timeouts/goodbye_partial_cutoff.rs, each asserting the receiver returns a typed io::Error rather than panic: - EOF mid-byte inside the legacy 4-byte NDX_DONE (UnexpectedEof from read_expected_ndx_done on proto 29). - EOF after a modern 0xFF prefix on proto 32 handle_goodbye (UnexpectedEof). - Immediate EOF before any goodbye byte on both proto 29 and 32 (UnexpectedEof). - Well-framed positive NDX (5) in place of NDX_DONE on proto 32 (InvalidData with the expected NDX_DONE message preserved). - Legacy garbage rejection via read_expected_ndx_done on proto 29 (InvalidData with the context string preserved). - Hung sender that never produces bytes - bounded with mpsc::recv_timeout(2s); guards against a receiver that silently declares success on zero input, and accepts TimedOut or UnexpectedEof if a future change adds an internal deadline. - EOF inside the NDX_DEL_STATS varint payload (UnexpectedEof from DeleteStats::read_from). - Happy-path sanity check that well-formed NDX_DONE still drives the handshake cleanly. Protocol-coverage note: handle_goodbye only reads on proto >= 31; on proto 28/29 the read-side counterpart is read_expected_ndx_done called by exchange_phase_done. The legacy-codec EOF / garbage tests therefore target read_expected_ndx_done directly; the modern-codec tests target handle_goodbye directly. Updates docs/audits/edg-goodbye-contract.md with a new "Timeout + partial-cutoff (EDG-GOODBYE.4)" section that enumerates the covered cases and the regressions they guard against. Upstream reference: main.c:893-924 read_final_goodbye() - exits with RERR_PROTOCOL on a non-NDX_DONE final read and propagates I/O errors from read_int / read_ndx_and_attrs on short reads.
5 tasks
…off-timeout test(receiver): EDG-GOODBYE.4 partial-cutoff + hung-sender goodbye tests
3 tasks
oferchen
added a commit
that referenced
this pull request
Jun 19, 2026
UTS-NEXTEST-EDGE.e: native nextest port of upstream's testsuite/daemon-gzip-download.test and daemon-gzip-upload.test, which exercise the -zz (zlibx) per-block codec over a daemon transfer in both directions. Asserts byte-identical round-trip, intact goodbye envelope (no UTS-9 'connection unexpectedly closed' signature past the ~615KB cutoff), and codec-engaged evidence via --stats. Adds a -z vs -zz negotiation pin so silent codec collapse trips a regression. Companion to PRs #5520, #5600, #5619 and the UTS-V3 cluster A drain; the upstream tests run under continue-on-error in CI, so this nextest port runs as a required check on every PR.
oferchen
added a commit
that referenced
this pull request
Jun 19, 2026
* test(uts): port daemon-gzip download/upload -zz to nextest UTS-NEXTEST-EDGE.e: native nextest port of upstream's testsuite/daemon-gzip-download.test and daemon-gzip-upload.test, which exercise the -zz (zlibx) per-block codec over a daemon transfer in both directions. Asserts byte-identical round-trip, intact goodbye envelope (no UTS-9 'connection unexpectedly closed' signature past the ~615KB cutoff), and codec-engaged evidence via --stats. Adds a -z vs -zz negotiation pin so silent codec collapse trips a regression. Companion to PRs #5520, #5600, #5619 and the UTS-V3 cluster A drain; the upstream tests run under continue-on-error in CI, so this nextest port runs as a required check on every PR. * test: fix doc-lazy-continuation lint in daemon-gzip-zz module doc Reword 'capability advertise + compress' to 'capability advertise and compress' so clippy doesn't parse the wrapped '+' as a markdown list marker.
1 of 4 tasks
oferchen
added a commit
that referenced
this pull request
Jun 19, 2026
Adds the cross-binary upstream-compat harness primitives specified by NXT-1 (`UpstreamVersion`, `locate_upstream_rsync`, `require_upstream_rsync`, `upstream_compat_enabled`) and ports the upstream `daemon-gzip-download.test` goodbye-flush invariant into nextest. The test pairs an upstream rsync 3.4.4 client against an oc-rsync daemon over TCP and pulls a ~1 MB `-zz`-compressed fixture sized to clear the UTS-9 ~615 KB cutoff. The invariant pinned is that the daemon-sender goodbye envelope reaches the upstream client without a premature connection drop - the regression family fixed by PRs #5520 / #5600 / #5619 / #5725. Self-skips on three conditions: `OC_RSYNC_UPSTREAM_COMPAT` env var unset (default for PR cells), upstream rsync 3.4.4 binary not present at `target/interop/upstream-install/3.4.4/bin/rsync`, or the oc-rsync binary cannot be located. Wall-time impact on the standard PR cell is a single early-return. NXT-1 calls out that the new `upstream-compat` CI cell is the wire-up step that flips the env var on. That cell does not exist yet; this PR ships the test and harness only, and a follow-up will add the matrix entry to the existing nextest workflow. Refs: docs/design/nxt-1-nextest-harness.md
oferchen
added a commit
that referenced
this pull request
Jun 19, 2026
…6002) Adds the cross-binary upstream-compat harness primitives specified by NXT-1 (`UpstreamVersion`, `locate_upstream_rsync`, `require_upstream_rsync`, `upstream_compat_enabled`) and ports the upstream `daemon-gzip-download.test` goodbye-flush invariant into nextest. The test pairs an upstream rsync 3.4.4 client against an oc-rsync daemon over TCP and pulls a ~1 MB `-zz`-compressed fixture sized to clear the UTS-9 ~615 KB cutoff. The invariant pinned is that the daemon-sender goodbye envelope reaches the upstream client without a premature connection drop - the regression family fixed by PRs #5520 / #5600 / #5619 / #5725. Self-skips on three conditions: `OC_RSYNC_UPSTREAM_COMPAT` env var unset (default for PR cells), upstream rsync 3.4.4 binary not present at `target/interop/upstream-install/3.4.4/bin/rsync`, or the oc-rsync binary cannot be located. Wall-time impact on the standard PR cell is a single early-return. NXT-1 calls out that the new `upstream-compat` CI cell is the wire-up step that flips the env var on. That cell does not exist yet; this PR ships the test and harness only, and a follow-up will add the matrix entry to the existing nextest workflow. Refs: docs/design/nxt-1-nextest-harness.md
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
test(protocol): lock daemon-sender goodbye NDX_DONE contract
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
* test(uts): port daemon-gzip download/upload -zz to nextest UTS-NEXTEST-EDGE.e: native nextest port of upstream's testsuite/daemon-gzip-download.test and daemon-gzip-upload.test, which exercise the -zz (zlibx) per-block codec over a daemon transfer in both directions. Asserts byte-identical round-trip, intact goodbye envelope (no UTS-9 'connection unexpectedly closed' signature past the ~615KB cutoff), and codec-engaged evidence via --stats. Adds a -z vs -zz negotiation pin so silent codec collapse trips a regression. Companion to PRs #5520, #5600, #5619 and the UTS-V3 cluster A drain; the upstream tests run under continue-on-error in CI, so this nextest port runs as a required check on every PR. * test: fix doc-lazy-continuation lint in daemon-gzip-zz module doc Reword 'capability advertise + compress' to 'capability advertise and compress' so clippy doesn't parse the wrapped '+' as a markdown list marker.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…6002) Adds the cross-binary upstream-compat harness primitives specified by NXT-1 (`UpstreamVersion`, `locate_upstream_rsync`, `require_upstream_rsync`, `upstream_compat_enabled`) and ports the upstream `daemon-gzip-download.test` goodbye-flush invariant into nextest. The test pairs an upstream rsync 3.4.4 client against an oc-rsync daemon over TCP and pulls a ~1 MB `-zz`-compressed fixture sized to clear the UTS-9 ~615 KB cutoff. The invariant pinned is that the daemon-sender goodbye envelope reaches the upstream client without a premature connection drop - the regression family fixed by PRs #5520 / #5600 / #5619 / #5725. Self-skips on three conditions: `OC_RSYNC_UPSTREAM_COMPAT` env var unset (default for PR cells), upstream rsync 3.4.4 binary not present at `target/interop/upstream-install/3.4.4/bin/rsync`, or the oc-rsync binary cannot be located. Wall-time impact on the standard PR cell is a single early-return. NXT-1 calls out that the new `upstream-compat` CI cell is the wire-up step that flips the env var on. That cell does not exist yet; this PR ships the test and harness only, and a follow-up will add the matrix entry to the existing nextest workflow. Refs: docs/design/nxt-1-nextest-harness.md
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.
Summary
--delete, push +-z, proto-30 gate, proto-29 legacy 4-byte form). Goldens are built in-process via the same codec primitives the productionGeneratorContext::handle_goodbyeuses, so the test is deterministic and self-contained -- no external.binfixtures.NDX_DONEsentinel across all iterations -- gives ~1% sensitivity to flakes that would surface as the UTS-9.REOPEN / UTS-15.c failure mode. Full-daemon stress is intentionally out of scope here; this loop pins the codec invariant those tasks build on.(protocol in 28..=32, send_del_stats, DeleteStats)combinations. The headline contract is that the last protocol-frame must always beNDX_DONEwith no trailing bytes; additional cases pin thatNDX_DEL_STATSis always followed by exactly five varints +NDX_DONE, and that protocol < 31 never emitsNDX_DEL_STATSregardless of the request flag.docs/audits/edg-goodbye-contract.mddescribing the wire contract, the failure modes the test set guards against, and the upstreammain.c/generator.c/rsync.c/io.cline references each clause maps to. UTS-9.REOPEN and UTS-15.c can land regressions against this machine-checked invariant.Test plan
cargo nextest run -p protocol --all-features -E 'test(goodbye_contract::)'-- new contract tests pass.goodbye_handshake.rstests continue to pass (covers rawwrite_goodbye/read_goodbyecodec; no overlap with the contract tests in this PR).cargo nextest run -p protocol --all-featuresfull crate suite green -- catches any regression from the new file.