From f6173858a2d9a64ac08d219b2cfb03042ef09915 Mon Sep 17 00:00:00 2001 From: santoshkumarradha Date: Mon, 2 Nov 2026 05:11:27 -0500 Subject: [PATCH 1/2] tests: keeping an unsent turn on an ownership check needs the store to answer TestOwnershipCheckThatFindsAnotherHolderKeepsUnsentTurns kept the store blocked through CheckLease, but keeping the turn uploads it as a branch, and Batcher.lost documents that a failed branch stays stale for the next flush to retry. The check could never keep the turn, so the test failed on its premise. It now refuses only A's heartbeats (quiet) and lets the store answer before the check, so only the check can learn of the move and the kept-turn notice is still required by the time it returns. --- internal/syncsetup/drive_refusal_safety_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/syncsetup/drive_refusal_safety_test.go b/internal/syncsetup/drive_refusal_safety_test.go index 059731fd50..73731ccf0e 100644 --- a/internal/syncsetup/drive_refusal_safety_test.go +++ b/internal/syncsetup/drive_refusal_safety_test.go @@ -125,6 +125,10 @@ func TestOwnershipCheckThatFindsAnotherHolderKeepsUnsentTurns(t *testing.T) { if _, err := h.continuerB().Take(ctx, h.cell.ID); err != nil { t.Fatal(err) } + // Keeping the turn uploads it as a branch, so the store must answer; A's + // heartbeats stay refused so only the check can learn of the move. + h.quiet.Store(true) + h.block.set(false) // The check alone, not a later flush, keeps the turn: it is kept by the // time the check returns. mustNil(t, a.drive.CheckLease(ctx)) @@ -134,5 +138,4 @@ func TestOwnershipCheckThatFindsAnotherHolderKeepsUnsentTurns(t *testing.T) { if a.drive.Gate() == nil { t.Fatal("a displaced window still admits work") } - h.block.set(false) } From e763660b3ab20c673717b6b6b24c17c480327db2 Mon Sep 17 00:00:00 2001 From: santoshkumarradha Date: Mon, 2 Nov 2026 05:12:36 -0500 Subject: [PATCH 2/2] docs: change entry for this pull request --- docs/changes/unreleased/2184-kept-turn-test.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docs/changes/unreleased/2184-kept-turn-test.md diff --git a/docs/changes/unreleased/2184-kept-turn-test.md b/docs/changes/unreleased/2184-kept-turn-test.md new file mode 100644 index 0000000000..bc2958f979 --- /dev/null +++ b/docs/changes/unreleased/2184-kept-turn-test.md @@ -0,0 +1,6 @@ +--- +kind: internal +title: The kept-turn ownership test lets the store answer so the branch can upload +pr: 2184 +surface: [chat] +---