(t *testing.T)
| 5811 | } |
| 5812 | |
| 5813 | func TestPassiveServerDoesNotProcess(t *testing.T) { |
| 5814 | t.Parallel() |
| 5815 | |
| 5816 | ctx := testutil.Context(t, testutil.WaitLong) |
| 5817 | db, ps := dbtestutil.NewDB(t, dbtestutil.WithDumpOnFailure()) |
| 5818 | user, org, model := seedChatDependencies(t, db) |
| 5819 | |
| 5820 | server := newTestServer(t, db, ps, uuid.New()) |
| 5821 | chat, err := server.CreateChat(ctx, chatd.CreateOptions{ |
| 5822 | OrganizationID: org.ID, |
| 5823 | OwnerID: user.ID, |
| 5824 | Title: "should-stay-pending", |
| 5825 | InitialUserContent: []codersdk.ChatMessagePart{{Type: codersdk.ChatMessagePartTypeText, Text: "hello"}}, |
| 5826 | ModelConfigID: model.ID, |
| 5827 | }) |
| 5828 | require.NoError(t, err) |
| 5829 | |
| 5830 | chatd.WaitUntilIdleForTest(server) |
| 5831 | |
| 5832 | // Re-read from DB to catch any unexpected state transition. |
| 5833 | stored, err := db.GetChatByID(ctx, chat.ID) |
| 5834 | require.NoError(t, err) |
| 5835 | require.Equal(t, database.ChatStatusPending, stored.Status) |
| 5836 | } |
| 5837 | |
| 5838 | // newStartedTestServer creates a server with Start() called. |
| 5839 | // Uses a long acquire interval so processing is triggered by |
nothing calls this directly
no test coverage detected