From 100ebd9f3be4b284cc1c5cda6ee4e80e20d4b319 Mon Sep 17 00:00:00 2001 From: Ethan <39577870+ethanndickson@users.noreply.github.com> Date: Thu, 7 May 2026 17:12:12 +1000 Subject: [PATCH] test(coderd/x/chatd): deflake advisor chain mode snapshot (#25021) `TestAdvisorChainMode_SnapshotKeepsFullHistory` was using the generic active chatd test server, which leaves periodic pending-chat polling enabled. That made the test inconsistent with the other OpenAI Responses API tests and allowed stale pending pubsub notifications to interrupt the second turn before the advisor request was observed. Use the existing OpenAI Responses test server helper so pending-chat acquisition is delayed and the test only starts processing after the SendMessage pending notification has been published. Closes https://github.com/coder/internal/issues/1510 --- coderd/x/chatd/chatd_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coderd/x/chatd/chatd_test.go b/coderd/x/chatd/chatd_test.go index 1f667ab1b7..eb6501447b 100644 --- a/coderd/x/chatd/chatd_test.go +++ b/coderd/x/chatd/chatd_test.go @@ -9961,7 +9961,7 @@ func TestAdvisorChainMode_SnapshotKeepsFullHistory(t *testing.T) { MaxUsesPerRun: 3, MaxOutputTokens: 16384, }) - server := newActiveTestServer(t, db, ps) + server := newOpenAIResponsesTestServer(t, db, ps) chat, err := server.CreateChat(ctx, chatd.CreateOptions{ OrganizationID: org.ID,