From bd19f69e957040a57f8d0d5bcf366eaaf9d037ce Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 30 Oct 2026 17:20:05 -0500 Subject: [PATCH] test(github): distinguish failed removal attempts from settled replay Co-Authored-By: Paperclip --- server/src/__tests__/github-connection-work.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/__tests__/github-connection-work.test.ts b/server/src/__tests__/github-connection-work.test.ts index 41ba2724079..1ab9882772a 100644 --- a/server/src/__tests__/github-connection-work.test.ts +++ b/server/src/__tests__/github-connection-work.test.ts @@ -125,6 +125,7 @@ describeDatabase("GitHub coordinator with PostgreSQL and controlled Cloud HTTP ( const [failed] = await db.select().from(connectionGrants).where(eq(connectionGrants.id, f.grant.id)); expect(failed!.providerTenant!.github!.bindingSync!.removeInstallationIds).toEqual(["202"]); const retryAt = Date.parse(failed!.providerTenant!.github!.continuityRetry!.at); + const attemptedRemovals = bindings.filter(binding => binding.installationId === "202").length; const restarted = createGitHubGrantContinuity(db, f.dependencies); expect(await restarted.nextGitHubConnectionContinuityAt()).toBe(retryAt); await vi.advanceTimersByTimeAsync(29_000); @@ -133,7 +134,7 @@ describeDatabase("GitHub coordinator with PostgreSQL and controlled Cloud HTTP ( await Promise.all([restarted.sweepGitHubConnectionContinuity(), restarted.sweepGitHubConnectionContinuity()]); const [saved] = await db.select().from(connectionGrants).where(eq(connectionGrants.id, f.grant.id)); expect(saved!.providerTenant!.github!.bindingSync).toBeUndefined(); expect(saved!.providerTenant!.github!.continuityRetry).toBeUndefined(); - expect(bindings.filter(binding => binding.installationId === "202")).toHaveLength(1); + expect(bindings.filter(binding => binding.installationId === "202")).toHaveLength(attemptedRemovals + 1); expect(githubRequests).toBe(0); expect(await restarted.nextGitHubConnectionContinuityAt()).toBeGreaterThan(Date.now()); await db.update(toolConnections).set({ enabled: false }).where(eq(toolConnections.id, f.connection.id));