From d2dd942bd0ba739c52f0cbb4146fccb32810565a Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 2 Nov 2026 14:17:54 -0600 Subject: [PATCH] Order Discord metadata-only comment snapshots deterministically Keep exact comment membership assertions stable across PostgreSQL row orders and bound the existing external integration fixture with a typed four-connection option. Co-Authored-By: Paperclip --- server/src/__tests__/chat-channels.integration.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/__tests__/chat-channels.integration.test.ts b/server/src/__tests__/chat-channels.integration.test.ts index 08c61039a80..97231f297f3 100644 --- a/server/src/__tests__/chat-channels.integration.test.ts +++ b/server/src/__tests__/chat-channels.integration.test.ts @@ -1122,6 +1122,7 @@ describeEmbeddedPostgres("chat channel control-plane integration", () => { // Do not expire or time out its connections on those virtual clock jumps. db = createDb(externalTestDatabaseUrl ?? tempDb!.connectionString, { idleTimeoutSeconds: 0, connectTimeoutSeconds: 0, maxLifetimeSeconds: 0, + ...(externalTestDatabaseUrl ? { maxConnections: 4 } : {}), }); }, 90_000); @@ -60453,7 +60454,8 @@ describeEmbeddedPostgres("chat channel control-plane integration", () => { const commentsBefore = await db .select({ id: issueComments.id }) .from(issueComments) - .where(eq(issueComments.issueId, conversation.issueId)); + .where(eq(issueComments.issueId, conversation.issueId)) + .orderBy(asc(issueComments.id)); const wakesBefore = wakeup.mock.calls.length; const reactionsBefore = providerRuntime.reactions.length; const postsBefore = providerRuntime.posts.length; @@ -60483,7 +60485,8 @@ describeEmbeddedPostgres("chat channel control-plane integration", () => { await db .select({ id: issueComments.id }) .from(issueComments) - .where(eq(issueComments.issueId, conversation.issueId)), + .where(eq(issueComments.issueId, conversation.issueId)) + .orderBy(asc(issueComments.id)), ).toEqual(commentsBefore); expect(wakeup).toHaveBeenCalledTimes(wakesBefore); expect(cancelRun).not.toHaveBeenCalled();