From 9bbd667a341e862ffdec0b1d20cb8a830bc03cfd Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sun, 29 Nov 2026 08:31:21 -0800 Subject: [PATCH] test: expire the attach object call independently of assignment wait --- .../frontend/durable/provider_startup_outcome_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/seaweed-block/core/frontend/durable/provider_startup_outcome_test.go b/seaweed-block/core/frontend/durable/provider_startup_outcome_test.go index fe93654ab8..d275dc76b0 100644 --- a/seaweed-block/core/frontend/durable/provider_startup_outcome_test.go +++ b/seaweed-block/core/frontend/durable/provider_startup_outcome_test.go @@ -109,8 +109,10 @@ func TestChunkStartupSealedAssignmentStaysForReplay(t *testing.T) { } } -// The attach check returns a retained disposition only AFTER its context's -// deadline. This makes the timeout-defer boundary causal, not a scheduler race. +// The attach check returns a retained disposition only AFTER the assignment +// allowance and a bounded object call expire. The assignment allowance itself +// no longer cancels growing attach work; a failed object call still must not +// replace a retained disposition with a process retry. func TestChunkStartupRetainedDispositionWinsExpiredAttachContext(t *testing.T) { for _, tc := range []struct { name string @@ -134,7 +136,9 @@ func TestChunkStartupRetainedDispositionWinsExpiredAttachContext(t *testing.T) { ChunkAssignmentTimeout: 250 * time.Millisecond, ChunkAttachCheck: func(ctx context.Context, _ string, _ durable.ChunkGeometry) error { entered.Store(true) - <-ctx.Done() + object, cancel := context.WithTimeout(ctx, 300*time.Millisecond) + defer cancel() + <-object.Done() return tc.err }, }