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

Method startWithFirstUser

enterprise/coderd/coderd_test.go:1054–1071  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1052}
1053
1054func (s *restartableTestServer) startWithFirstUser(t *testing.T) (client *codersdk.Client, firstUser codersdk.CreateFirstUserResponse) {
1055 t.Helper()
1056 s.mu.Lock()
1057 defer s.mu.Unlock()
1058
1059 if s.closer != nil || s.api != nil {
1060 t.Fatal("server already started, close must be called first")
1061 }
1062 // This creates it's own TCP listener unfortunately, but it's not being
1063 // used in this test.
1064 client, s.closer, s.api, firstUser = coderdenttest.NewWithAPI(t, s.options)
1065
1066 // Never add the first user or license on subsequent restarts.
1067 s.options.DontAddFirstUser = true
1068 s.options.DontAddLicense = true
1069
1070 return client, firstUser
1071}
1072
1073// Test_CoordinatorRollingRestart tests that two peers can maintain a connection
1074// without forgetting about each other when a HA coordinator does a rolling

Callers 2

newRestartableTestServerFunction · 0.95
StartMethod · 0.95

Calls 5

NewWithAPIFunction · 0.92
FatalMethod · 0.80
HelperMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected