test: expire the attach object call independently of assignment wait

This commit is contained in:
pingqiu committed 2026-11-29 08:31:21 -08:00
1 parent dc5e9a1f3b
commit 9bbd667a34
1 file changed
+7 -3
@@ -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
},
}