From 1aa60c159ebaac6c47799cd41bca6931ea3f85a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=AB=A0=E6=B5=A9?= Date: Mon, 2 Nov 2026 20:39:01 +0800 Subject: [PATCH] =?UTF-8?q?test(library):=20F4=20=E6=AD=A3=E4=BE=8B?= =?UTF-8?q?=E6=8C=89=E5=9F=BA=E7=BA=BF=E8=AE=A1=E6=95=B0=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E8=BD=AC=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 写入精确 marker 本身会经过 wire;断言应比较确认前后的增量,而不是绝对值。 --- .../releaseadapter/v071/library_index_ds01_fixes_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/releaseadapter/v071/library_index_ds01_fixes_test.go b/internal/releaseadapter/v071/library_index_ds01_fixes_test.go index 41fdb2a..e1b0b9c 100644 --- a/internal/releaseadapter/v071/library_index_ds01_fixes_test.go +++ b/internal/releaseadapter/v071/library_index_ds01_fixes_test.go @@ -165,6 +165,8 @@ func TestDS01BindingConflictRejectedInEveryState(t *testing.T) { if err != nil { t.Fatal(err) } + // 从这里开始只允许确认,不允许任何新的 marker create。 + beforeDispatch := wire.dispatch conflict := func(state string) *ds01StubGate { return &ds01StubGate{inspectFound: true, inspectStatus: libraryrelease.RestoreDispatchStatus{ State: state, Held: true, BindingConflict: true, Reason: "binding differs"}, @@ -220,8 +222,8 @@ func TestDS01BindingConflictRejectedInEveryState(t *testing.T) { if okGate.confirmed != 1 { t.Fatalf("legitimate marker confirmation count = %d", okGate.confirmed) } - if wire.dispatch != 0 { - t.Fatalf("confirmation path forwarded %d marker writes", wire.dispatch) + if wire.dispatch != beforeDispatch { + t.Fatalf("confirmation path forwarded %d marker writes", wire.dispatch-beforeDispatch) } }