@@ -103,8 +103,7 @@ ALTER TENANT application START SERVICE SHARED`)
103103 continue
104104 }
105105
106- sqlAddr := tc .Server (i ).AdvSQLAddr ()
107- db , err := serverutils .OpenDBConnE (sqlAddr , "cluster:application" , false , tc .Stopper ())
106+ db , err := tc .Server (i ).SystemLayer ().SQLConnE ("cluster:application" )
108107 if err != nil {
109108 return err
110109 }
@@ -194,8 +193,7 @@ func TestServerControllerHTTP(t *testing.T) {
194193 t .Logf ("connecting to the test tenant" )
195194
196195 // Get a SQL connection to the test tenant.
197- sqlAddr := s .AdvSQLAddr ()
198- db2 , err := serverutils .OpenDBConnE (sqlAddr , "cluster:hello/defaultdb" , false , s .Stopper ())
196+ db2 , err := s .SystemLayer ().SQLConnE ("cluster:hello/defaultdb" )
199197 // Expect no error yet: the connection is opened lazily; an
200198 // error here means the parameters were incorrect.
201199 require .NoError (t , err )
@@ -443,7 +441,7 @@ func TestServerControllerMultiNodeTenantStartup(t *testing.T) {
443441 sqlAddr := tc .Server (serverIdx ).AdvSQLAddr ()
444442 t .Logf ("attempting to use tenant server on node %d (%s)" , serverIdx , sqlAddr )
445443 testutils .SucceedsSoon (t , func () error {
446- tenantDB , err := serverutils . OpenDBConnE ( sqlAddr , "cluster:hello" , false , tc . Stopper () )
444+ tenantDB , err := tc . Server ( serverIdx ). SystemLayer (). SQLConnE ( "cluster:hello" )
447445 if err != nil {
448446 t .Logf ("error connecting to tenant server (will retry): %v" , err )
449447 return err
@@ -481,8 +479,6 @@ func TestServerStartStop(t *testing.T) {
481479 })
482480 defer s .Stopper ().Stop (ctx )
483481
484- sqlAddr := s .AdvSQLAddr ()
485-
486482 // Create our own test tenant with a known name.
487483 _ , err := db .Exec ("CREATE TENANT hello" )
488484 require .NoError (t , err )
@@ -493,7 +489,7 @@ func TestServerStartStop(t *testing.T) {
493489
494490 // Check the liveness.
495491 testutils .SucceedsSoon (t , func () error {
496- db2 , err := serverutils . OpenDBConnE ( sqlAddr , "cluster:hello/defaultdb" , false , s . Stopper () )
492+ db2 , err := s . SystemLayer (). SQLConnE ( "cluster:hello/defaultdb" )
497493 // Expect no error yet: the connection is opened lazily; an
498494 // error here means the parameters were incorrect.
499495 require .NoError (t , err )
@@ -517,7 +513,7 @@ func TestServerStartStop(t *testing.T) {
517513
518514 // Verify that the service is indeed stopped.
519515 testutils .SucceedsSoon (t , func () error {
520- db2 , err := serverutils . OpenDBConnE ( sqlAddr , "cluster:hello/defaultdb" , false , s . Stopper () )
516+ db2 , err := s . SystemLayer (). SQLConnE ( "cluster:hello/defaultdb" )
521517 // Expect no error yet: the connection is opened lazily; an
522518 // error here means the parameters were incorrect.
523519 require .NoError (t , err )
0 commit comments