From 4bf413af7176aa4f983cd4e2e1c744a8f5510fd3 Mon Sep 17 00:00:00 2001 From: Xiaoyang Han Date: Thu, 8 Oct 2026 06:56:48 +0800 Subject: [PATCH] test(v3): account for cold raw proof and instrument retry source opens The exact native suite exposed two test accounting errors. Cold raw opens one source to earn its receipt and one for authenticated delivery; its revocation regression now requires both passes while retaining rejected-tail, zero range IO and exact byte accounting. The admission/cancellation source-builder regression now increments its existing loader counter on its real successful retry, preserving the required two source opens, credit refund, producer drop and chunk verification. Production behavior is unchanged. --- src/api/router/snapshot_session_tests.rs | 10 ++++++++-- src/ceres/snapshot/chunks_stream_tests.rs | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/api/router/snapshot_session_tests.rs b/src/api/router/snapshot_session_tests.rs index 36101a05..68feb23a 100644 --- a/src/api/router/snapshot_session_tests.rs +++ b/src/api/router/snapshot_session_tests.rs @@ -861,9 +861,15 @@ async fn mst2_durable_http_frame_and_raw_delivery_recheck_after_release() { "revocation must suppress the next raw block or END frame" ); assert!(stream.next().await.is_none()); + // Cold raw first earns an immutable receipt, then opens the separate + // authenticated delivery stream. Revocation still suppresses its tail. fixture.counts.assert( - if raw { 1 } else { 0 }, - if raw { fixture.raw.len() } else { 0 }, + if raw { 2 } else { 0 }, + if raw { + fixture.raw.len() + first.len() + } else { + 0 + }, ); } } diff --git a/src/ceres/snapshot/chunks_stream_tests.rs b/src/ceres/snapshot/chunks_stream_tests.rs index 2cf7fb53..61de6453 100644 --- a/src/ceres/snapshot/chunks_stream_tests.rs +++ b/src/ceres/snapshot/chunks_stream_tests.rs @@ -104,7 +104,10 @@ async fn exact_source_builder_admits_all_install_workspace_before_open_and_cance let projection = build_source_with_resources( digest, size, - || async { Ok(stream(vec![Ok(raw.clone())])) }, + || async { + opens.fetch_add(1, Ordering::SeqCst); + Ok(stream(vec![Ok(raw.clone())])) + }, &budget, &builders, )