( ctx context.Context, t testing.TB, db database.Store, chatID uuid.UUID, )
| 106 | } |
| 107 | |
| 108 | func waitForChatTerminalState( |
| 109 | ctx context.Context, |
| 110 | t testing.TB, |
| 111 | db database.Store, |
| 112 | chatID uuid.UUID, |
| 113 | ) { |
| 114 | t.Helper() |
| 115 | |
| 116 | require.Eventually(t, func() bool { |
| 117 | chat, err := getChatByIDAsSystem(ctx, db, chatID) |
| 118 | if err != nil { |
| 119 | return false |
| 120 | } |
| 121 | return chat.Status != database.ChatStatusPending && chat.Status != database.ChatStatusRunning |
| 122 | }, testutil.WaitLong, testutil.IntervalFast) |
| 123 | } |
| 124 | |
| 125 | func getChatByIDAsSystem( |
| 126 | ctx context.Context, |
no test coverage detected