MCPcopy Create free account
hub / github.com/coder/coder / newActiveWorkerServer

Function newActiveWorkerServer

enterprise/coderd/x/chatd/chatd_test.go:81–102  ·  view source on GitHub ↗
(
	t *testing.T,
	db database.Store,
	ps dbpubsub.Pubsub,
	replicaID uuid.UUID,
)

Source from the content-addressed store, hash-verified

79}
80
81func newActiveWorkerServer(
82 t *testing.T,
83 db database.Store,
84 ps dbpubsub.Pubsub,
85 replicaID uuid.UUID,
86) *osschatd.Server {
87 t.Helper()
88 logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
89 server := osschatd.New(osschatd.Config{
90 Logger: logger,
91 Database: db,
92 ReplicaID: replicaID,
93 Pubsub: ps,
94 PendingChatAcquireInterval: 10 * time.Millisecond,
95 InFlightChatStaleAfter: testutil.WaitSuperLong,
96 })
97 server.Start()
98 t.Cleanup(func() {
99 require.NoError(t, server.Close())
100 })
101 return server
102}
103
104// seedChatDependencies creates a user, organization, and chat model
105// config in the database for use in relay tests.

Calls 5

HelperMethod · 0.65
NewMethod · 0.65
StartMethod · 0.65
CleanupMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected