From 33cf9a079949276d0343dcc1628f229f2492439c Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 24 Nov 2026 18:18:39 -0600 Subject: [PATCH] Wait for GitHub recovery to settle before asserting its deadline Core master's Cloud readiness has failed the chat (1/3) shard on most commits since #22798, which stopped master Docker images and every production rollout. The recovery-deadline test asserted nextWakeAt equal to the saved deadline immediately after registration. In the master shard a recovery-queue notification from the previous case's cleanup arrives after registration, marks the scope dirty, and the coordinator correctly schedules an immediate rescan first, so nextWakeAt briefly equals now (30s early). The test now polls until the coordinator is idle and settled on the saved deadline before checking that no reads happen in the next 15s. Tested: on the pre-split file, the master chat shard 1/3 failed 5/5 before (expected X to be X+30000) and passed 2/2 after. The split github-webhook-recovery suite passes (51 tests). Co-Authored-By: Claude Opus 5.5 --- .../chat-channels/github-webhook-recovery.integration.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/__tests__/chat-channels/github-webhook-recovery.integration.test.ts b/server/src/__tests__/chat-channels/github-webhook-recovery.integration.test.ts index b45648a3d39..7ae6aa0a962 100644 --- a/server/src/__tests__/chat-channels/github-webhook-recovery.integration.test.ts +++ b/server/src/__tests__/chat-channels/github-webhook-recovery.integration.test.ts @@ -493,8 +493,8 @@ describeEmbeddedPostgres("chat channels: github webhook recovery", () => { try { vi.useFakeTimers({ toFake: ["Date", "setTimeout", "clearTimeout"], shouldAdvanceTime: true }); await f.service.registerGitHubWebhookRecoveryWork(coordinator, () => true).ready; - await expect.poll(() => idleWorkSnapshot().active).toBe(0); - expect(coordinator.nextWakeAt()).toBe(dueAt); + await expect.poll(() => ({ active: idleWorkSnapshot().active, nextWakeAt: coordinator.nextWakeAt() })) + .toEqual({ active: 0, nextWakeAt: dueAt }); const reads = vi.spyOn(db, "select"); try { await vi.advanceTimersByTimeAsync(15_000); expect(reads).not.toHaveBeenCalled(); } finally { reads.mockRestore(); }