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

Function newStartedTestServer

coderd/x/chatd/chatd_test.go:5841–5862  ·  view source on GitHub ↗

newStartedTestServer creates a server with Start() called. Uses a long acquire interval so processing is triggered by wake signals, not polling.

(
	t *testing.T,
	db database.Store,
	ps dbpubsub.Pubsub,
	replicaID uuid.UUID,
)

Source from the content-addressed store, hash-verified

5839// Uses a long acquire interval so processing is triggered by
5840// wake signals, not polling.
5841func newStartedTestServer(
5842 t *testing.T,
5843 db database.Store,
5844 ps dbpubsub.Pubsub,
5845 replicaID uuid.UUID,
5846) *chatd.Server {
5847 t.Helper()
5848
5849 logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
5850 server := chatd.New(chatd.Config{
5851 Logger: logger,
5852 Database: db,
5853 ReplicaID: replicaID,
5854 Pubsub: ps,
5855 PendingChatAcquireInterval: testutil.WaitLong,
5856 })
5857 server.Start()
5858 t.Cleanup(func() {
5859 require.NoError(t, server.Close())
5860 })
5861 return server
5862}
5863
5864// newDebugEnabledTestServer creates a passive test server with
5865// AlwaysEnableDebugLogs=true so that IsEnabled(ctx, chatID, ownerID)

Calls 5

NewFunction · 0.92
HelperMethod · 0.65
StartMethod · 0.65
CleanupMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected