Skip to content

Commit b972a27

Browse files
committed
testserver: rename Serving(RPC|SQL)Addr to Adv(RPC|SQL)Addr
Prior to this commit, we had methods on TestServer called "ServingXXXAddr" but under the hood were referring to the advertised addresses in the config struct. This was confusing. This patch updates the name of the methods to use "Adv" to be coherent with the field they are exposing. Release note: None
1 parent 4fd9f70 commit b972a27

File tree

112 files changed

+267
-267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+267
-267
lines changed

pkg/bench/pgbench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func BenchmarkPgbenchExec(b *testing.B) {
113113
defer s.Stopper().Stop(context.Background())
114114

115115
pgURL, cleanupFn := sqlutils.PGUrl(
116-
b, s.ServingSQLAddr(), "benchmarkCockroach", url.User(username.RootUser))
116+
b, s.AdvSQLAddr(), "benchmarkCockroach", url.User(username.RootUser))
117117
pgURL.RawQuery = "sslmode=disable"
118118
defer cleanupFn()
119119

pkg/bench/tpcc/tpcc_bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (bm *benchmark) startCockroach(b testing.TB) {
147147
}
148148

149149
pgURL, cleanup, err := sqlutils.PGUrlE(
150-
s.ServingSQLAddr(), b.TempDir(), url.User("root"),
150+
s.AdvSQLAddr(), b.TempDir(), url.User("root"),
151151
)
152152
require.NoError(b, err)
153153
pgURL.Path = databaseName

pkg/ccl/auditloggingccl/audit_logging_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func TestSingleRoleAuditLogging(t *testing.T) {
122122
defer s.Stopper().Stop(context.Background())
123123

124124
testUserURL, cleanupFn := sqlutils.PGUrl(t,
125-
s.ApplicationLayer().ServingSQLAddr(), t.Name(), url.User(username.TestUser))
125+
s.ApplicationLayer().AdvSQLAddr(), t.Name(), url.User(username.TestUser))
126126
defer cleanupFn()
127127

128128
testUserDb, err := gosql.Open("postgres", testUserURL.String())
@@ -254,7 +254,7 @@ func TestMultiRoleAuditLogging(t *testing.T) {
254254
defer s.Stopper().Stop(context.Background())
255255

256256
testUserURL, cleanupFn := sqlutils.PGUrl(t,
257-
s.ApplicationLayer().ServingSQLAddr(), t.Name(), url.User(username.TestUser))
257+
s.ApplicationLayer().AdvSQLAddr(), t.Name(), url.User(username.TestUser))
258258
defer cleanupFn()
259259

260260
testUserDb, err := gosql.Open("postgres", testUserURL.String())
@@ -375,7 +375,7 @@ func TestReducedAuditConfig(t *testing.T) {
375375
})
376376

377377
testUserURL, cleanupFn := sqlutils.PGUrl(t,
378-
s.ApplicationLayer().ServingSQLAddr(), t.Name(), url.User(username.TestUser))
378+
s.ApplicationLayer().AdvSQLAddr(), t.Name(), url.User(username.TestUser))
379379
defer cleanupFn()
380380

381381
testUserDb, err := gosql.Open("postgres", testUserURL.String())

pkg/ccl/backupccl/backup_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7513,7 +7513,7 @@ func TestClientDisconnect(t *testing.T) {
75137513
// Make credentials for the new connection.
75147514
sqlDB.Exec(t, `CREATE USER testuser`)
75157515
sqlDB.Exec(t, `GRANT admin TO testuser`)
7516-
pgURL, cleanup := sqlutils.PGUrl(t, tc.ApplicationLayer(0).ServingSQLAddr(),
7516+
pgURL, cleanup := sqlutils.PGUrl(t, tc.ApplicationLayer(0).AdvSQLAddr(),
75177517
"TestClientDisconnect-testuser", url.User("testuser"))
75187518
defer cleanup()
75197519

pkg/ccl/backupccl/create_scheduled_backup_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ func TestCreateBackupScheduleRequiresAdminRole(t *testing.T) {
971971

972972
th.sqlDB.Exec(t, `CREATE USER testuser`)
973973
pgURL, cleanupFunc := sqlutils.PGUrl(
974-
t, th.server.ApplicationLayer().ServingSQLAddr(),
974+
t, th.server.ApplicationLayer().AdvSQLAddr(),
975975
"TestCreateSchedule-testuser", url.User("testuser"),
976976
)
977977
defer cleanupFunc()

pkg/ccl/backupccl/datadriven_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (d *datadrivenTestState) getSQLDB(t *testing.T, name string, user string) *
230230
if db, ok := d.sqlDBs[key]; ok {
231231
return db
232232
}
233-
addr := d.firstNode[name].ApplicationLayer().ServingSQLAddr()
233+
addr := d.firstNode[name].ApplicationLayer().AdvSQLAddr()
234234
pgURL, cleanup := sqlutils.PGUrl(t, addr, "TestBackupRestoreDataDriven", url.User(user))
235235
d.cleanupFns = append(d.cleanupFns, cleanup)
236236

pkg/ccl/backupccl/show_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ func TestShowBackupPrivileges(t *testing.T) {
681681
sqlDB.Exec(t, `CREATE USER testuser`)
682682
sqlDB.Exec(t, `CREATE TABLE privs (a INT)`)
683683

684-
pgURL, cleanup := sqlutils.PGUrl(t, srv.ApplicationLayer().ServingSQLAddr(),
684+
pgURL, cleanup := sqlutils.PGUrl(t, srv.ApplicationLayer().AdvSQLAddr(),
685685
"TestShowBackupPrivileges-testuser", url.User("testuser"))
686686
defer cleanup()
687687
testuser, err := gosql.Open("postgres", pgURL.String())

pkg/ccl/changefeedccl/sink_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ func TestSQLSink(t *testing.T) {
480480
sqlDB := sqlutils.MakeSQLRunner(sqlDBRaw)
481481
sqlDB.Exec(t, `CREATE DATABASE d`)
482482

483-
pgURL, cleanup := sqlutils.PGUrl(t, s.ApplicationLayer().ServingSQLAddr(), t.Name(), url.User(username.RootUser))
483+
pgURL, cleanup := sqlutils.PGUrl(t, s.ApplicationLayer().AdvSQLAddr(), t.Name(), url.User(username.RootUser))
484484
defer cleanup()
485485
pgURL.Path = `d`
486486

pkg/ccl/cloudccl/cloudprivilege/privileges_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestURIRequiresAdminOrPrivilege(t *testing.T) {
4545

4646
rootDB.Exec(t, `CREATE USER testuser`)
4747
pgURL, cleanupFunc := sqlutils.PGUrl(
48-
t, tc.ApplicationLayer(0).ServingSQLAddr(), "TestURIRequiresAdminRole-testuser",
48+
t, tc.ApplicationLayer(0).AdvSQLAddr(), "TestURIRequiresAdminRole-testuser",
4949
url.User("testuser"),
5050
)
5151
defer cleanupFunc()

pkg/ccl/serverccl/server_controller_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ ALTER TENANT application START SERVICE SHARED`)
103103
continue
104104
}
105105

106-
sqlAddr := tc.Server(i).ServingSQLAddr()
106+
sqlAddr := tc.Server(i).AdvSQLAddr()
107107
db, err := serverutils.OpenDBConnE(sqlAddr, "cluster:application", false, tc.Stopper())
108108
if err != nil {
109109
return err
@@ -194,7 +194,7 @@ func TestServerControllerHTTP(t *testing.T) {
194194
t.Logf("connecting to the test tenant")
195195

196196
// Get a SQL connection to the test tenant.
197-
sqlAddr := s.ServingSQLAddr()
197+
sqlAddr := s.AdvSQLAddr()
198198
db2, err := serverutils.OpenDBConnE(sqlAddr, "cluster:hello/defaultdb", false, s.Stopper())
199199
// Expect no error yet: the connection is opened lazily; an
200200
// error here means the parameters were incorrect.
@@ -440,7 +440,7 @@ func TestServerControllerMultiNodeTenantStartup(t *testing.T) {
440440
// Pick a random node, try to run some SQL inside that tenant.
441441
rng, _ := randutil.NewTestRand()
442442
serverIdx := int(rng.Int31n(int32(numNodes)))
443-
sqlAddr := tc.Server(serverIdx).ServingSQLAddr()
443+
sqlAddr := tc.Server(serverIdx).AdvSQLAddr()
444444
t.Logf("attempting to use tenant server on node %d (%s)", serverIdx, sqlAddr)
445445
testutils.SucceedsSoon(t, func() error {
446446
tenantDB, err := serverutils.OpenDBConnE(sqlAddr, "cluster:hello", false, tc.Stopper())
@@ -481,7 +481,7 @@ func TestServerStartStop(t *testing.T) {
481481
})
482482
defer s.Stopper().Stop(ctx)
483483

484-
sqlAddr := s.ServingSQLAddr()
484+
sqlAddr := s.AdvSQLAddr()
485485

486486
// Create our own test tenant with a known name.
487487
_, err := db.Exec("CREATE TENANT hello")

0 commit comments

Comments
 (0)