Skip to content

Commit c48783c

Browse files
committed
server: unexport TestServer
Release note: None
1 parent fc7ecee commit c48783c

File tree

10 files changed

+158
-158
lines changed

10 files changed

+158
-158
lines changed

pkg/server/connectivity_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestClusterConnectivity(t *testing.T) {
4646
defer leaktest.AfterTest(t)()
4747
defer log.Scope(t).Close(t)
4848

49-
// TODO(irfansharif): Teach TestServer to accept a list of join addresses
49+
// TODO(irfansharif): Teach testServer to accept a list of join addresses
5050
// instead of just one.
5151

5252
var testConfigurations = []struct {

pkg/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ func (s *Server) PreStart(ctx context.Context) error {
15221522
// Register the Migration service, to power internal crdb upgrades.
15231523
migrationServer := &migrationServer{server: s}
15241524
serverpb.RegisterMigrationServer(s.grpc.Server, migrationServer)
1525-
s.migrationServer = migrationServer // only for testing via TestServer
1525+
s.migrationServer = migrationServer // only for testing via testServer
15261526

15271527
// Register the KeyVisualizer Server
15281528
keyvispb.RegisterKeyVisualizerServer(s.grpc.Server, s.keyVisualizerServer)

pkg/server/server_controller_channel_orchestrator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func newChannelOrchestrator(
4545

4646
// serverStateUsingChannels coordinates the lifecycle of a tenant
4747
// server. It ensures sane concurrent behavior between:
48-
// - requests to start a server manually, e.g. via TestServer;
48+
// - requests to start a server manually, e.g. via testServer;
4949
// - async changes to the tenant service mode;
5050
// - quiescence of the outer stopper;
5151
// - RPC drain requests on the tenant server;

pkg/server/server_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestServerController(t *testing.T) {
3232
})
3333
defer s.Stopper().Stop(ctx)
3434

35-
ts := s.(*TestServer)
35+
ts := s.(*testServer)
3636

3737
d, err := ts.serverController.getServer(ctx, "system")
3838
require.NoError(t, err)

pkg/server/server_special_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ import (
3131
"github.com/stretchr/testify/require"
3232
)
3333

34-
// Tests in this file have a linter exception against casting to *TestServer.
34+
// Tests in this file have a linter exception against casting to *testServer.
3535

3636
func TestPanicRecovery(t *testing.T) {
3737
defer leaktest.AfterTest(t)()
3838
defer log.ScopeWithoutShowLogs(t).Close(t)
3939

4040
s := serverutils.StartServerOnly(t, base.TestServerArgs{})
4141
defer s.Stopper().Stop(context.Background())
42-
ts := s.(*TestServer)
42+
ts := s.(*testServer)
4343

4444
// Enable a test-only endpoint that induces a panic.
4545
ts.http.mux.Handle("/panic", http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
@@ -109,7 +109,7 @@ func TestSocketAutoNumbering(t *testing.T) {
109109
_, expectedPort, err := addr.SplitHostPort(s.SQLAddr(), "")
110110
require.NoError(t, err)
111111

112-
if socketPath := s.(*TestServer).Cfg.SocketFile; !strings.HasSuffix(socketPath, "."+expectedPort) {
112+
if socketPath := s.(*testServer).Cfg.SocketFile; !strings.HasSuffix(socketPath, "."+expectedPort) {
113113
t.Errorf("expected unix socket ending with port %q, got %q", expectedPort, socketPath)
114114
}
115115
}
@@ -127,7 +127,7 @@ func TestInternalSQL(t *testing.T) {
127127
conf.User = "root"
128128
// Configure pgx to connect on the loopback listener.
129129
conf.DialFunc = func(ctx context.Context, network, addr string) (net.Conn, error) {
130-
return s.(*TestServer).Server.loopbackPgL.Connect(ctx)
130+
return s.(*testServer).Server.loopbackPgL.Connect(ctx)
131131
}
132132
conn, err := pgx.ConnectConfig(ctx, conf)
133133
require.NoError(t, err)

pkg/server/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func TestPlainHTTPServer(t *testing.T) {
204204
})
205205
defer s.Stopper().Stop(context.Background())
206206

207-
// First, make sure that the TestServer's built-in client interface
207+
// First, make sure that the testServer's built-in client interface
208208
// still works in insecure mode.
209209
var data serverpb.JSONResponse
210210
testutils.SucceedsSoon(t, func() error {

pkg/server/settings_cache_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ func TestCachedSettingsServerRestart(t *testing.T) {
7979
},
8080
}
8181
var settingsCache []roachpb.KeyValue
82-
testServer := serverutils.StartServerOnly(t, serverArgs)
83-
closedts.TargetDuration.Override(ctx, &testServer.ClusterSettings().SV, 10*time.Millisecond)
84-
closedts.SideTransportCloseInterval.Override(ctx, &testServer.ClusterSettings().SV, 10*time.Millisecond)
82+
ts := serverutils.StartServerOnly(t, serverArgs)
83+
closedts.TargetDuration.Override(ctx, &ts.ClusterSettings().SV, 10*time.Millisecond)
84+
closedts.SideTransportCloseInterval.Override(ctx, &ts.ClusterSettings().SV, 10*time.Millisecond)
8585
testutils.SucceedsSoon(t, func() error {
86-
store, err := testServer.GetStores().(*kvserver.Stores).GetStore(1)
86+
store, err := ts.GetStores().(*kvserver.Stores).GetStore(1)
8787
if err != nil {
8888
return err
8989
}
@@ -97,7 +97,7 @@ func TestCachedSettingsServerRestart(t *testing.T) {
9797
settingsCache = settings
9898
return nil
9999
})
100-
testServer.Stopper().Stop(context.Background())
100+
ts.Stopper().Stop(context.Background())
101101

102102
s, err := serverutils.NewServer(serverArgs)
103103
if err != nil {
@@ -109,7 +109,7 @@ func TestCachedSettingsServerRestart(t *testing.T) {
109109
{
110110
getDialOpts := s.RPCContext().GRPCDialOptions
111111

112-
initConfig := newInitServerConfig(ctx, s.(*TestServer).Server.cfg, getDialOpts)
112+
initConfig := newInitServerConfig(ctx, s.(*testServer).Server.cfg, getDialOpts)
113113
inspectState, err := inspectEngines(
114114
context.Background(),
115115
s.Engines(),

0 commit comments

Comments
 (0)