From 52bcf38f0066750ce1551984b501db9c22ec9ffb Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 23 Aug 2026 21:32:07 -0700 Subject: [PATCH] test(git-watch): await initial resubscribe --- src/main/ipc/worktree-git-common-watch.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/ipc/worktree-git-common-watch.test.ts b/src/main/ipc/worktree-git-common-watch.test.ts index 17892b87517..02d24924430 100644 --- a/src/main/ipc/worktree-git-common-watch.test.ts +++ b/src/main/ipc/worktree-git-common-watch.test.ts @@ -586,9 +586,14 @@ describe('worktree git-common narrow watch (darwin)', () => { await replaceWorktreesRoot(commonDir, worktreesDir, retainedEntry) await vi.advanceTimersByTimeAsync(POLL_MS * RECONCILIATION_TICKS * 4) - expect(subscribeMock).toHaveBeenCalledTimes(2) + await vi.waitFor( + () => { + expect(subscribeMock).toHaveBeenCalledTimes(2) + expect(childSubscriptions[1]).toBeDefined() + }, + { timeout: 1_000 } + ) const stalePendingSubscription = childSubscriptions[1] - await replaceWorktreesRoot(commonDir, worktreesDir, retainedEntry) await vi.advanceTimersByTimeAsync(POLL_MS * RECONCILIATION_TICKS * 4) expect(