MCPcopy Index your code
hub / github.com/coder/coder / waitForChatTerminalState

Function waitForChatTerminalState

coderd/coderdtest/chat.go:108–123  ·  view source on GitHub ↗
(
	ctx context.Context,
	t testing.TB,
	db database.Store,
	chatID uuid.UUID,
)

Source from the content-addressed store, hash-verified

106}
107
108func 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
125func getChatByIDAsSystem(
126 ctx context.Context,

Callers 1

WaitForChatSettledFunction · 0.85

Calls 2

getChatByIDAsSystemFunction · 0.85
HelperMethod · 0.65

Tested by

no test coverage detected