@@ -99,9 +99,11 @@ func doTestSchemaChangeGCJob(t *testing.T, dropItem DropItem, ttlTime TTLTime) {
9999 // call to stop the TestServer. Otherwise, the quiesce step of shutting down
100100 // can hang forever waiting for the GC job.
101101 defer close (blockGC )
102- sqlDB := sqlutils .MakeSQLRunner (db )
103102
104- sqlDB .Exec (t , `SET CLUSTER SETTING sql.gc_job.wait_for_gc.interval = '1s';` )
103+ sysDB := sqlutils .MakeSQLRunner (srv .SystemLayer ().SQLConn (t ))
104+ sysDB .Exec (t , `SET CLUSTER SETTING sql.gc_job.wait_for_gc.interval = '1s';` )
105+
106+ sqlDB := sqlutils .MakeSQLRunner (db )
105107 // Refresh protected timestamp cache immediately to make MVCC GC queue to
106108 // process GC immediately.
107109 sqlDB .Exec (t , `SET CLUSTER SETTING kv.protectedts.poll_interval = '1s';` )
@@ -194,10 +196,10 @@ func doTestSchemaChangeGCJob(t *testing.T, dropItem DropItem, ttlTime TTLTime) {
194196
195197 if err := kvDB .Txn (ctx , func (ctx context.Context , txn * kv.Txn ) error {
196198 b := txn .NewBatch ()
197- descKey := catalogkeys .MakeDescMetadataKey (keys . SystemSQLCodec , myTableID )
199+ descKey := catalogkeys .MakeDescMetadataKey (s . Codec () , myTableID )
198200 descDesc := myTableDesc .DescriptorProto ()
199201 b .Put (descKey , descDesc )
200- descKey2 := catalogkeys .MakeDescMetadataKey (keys . SystemSQLCodec , myOtherTableID )
202+ descKey2 := catalogkeys .MakeDescMetadataKey (s . Codec () , myOtherTableID )
201203 descDesc2 := myOtherTableDesc .DescriptorProto ()
202204 b .Put (descKey2 , descDesc2 )
203205 return txn .Run (ctx , b )
@@ -353,7 +355,7 @@ WHERE job_id = %s`, jobID)).Scan(&state, &statusMessage, &jobErr)
353355 })
354356}
355357
356- // TestGCTenant is lightweight test that tests the branching logic in Resume
358+ // TestGCResumer is lightweight test that tests the branching logic in Resume
357359// depending on if the job is GC for tenant or tables/indexes.
358360func TestGCResumer (t * testing.T ) {
359361 defer leaktest .AfterTest (t )()
@@ -362,7 +364,12 @@ func TestGCResumer(t *testing.T) {
362364 defer gcjob .SetSmallMaxGCIntervalForTest ()()
363365
364366 ctx := context .Background ()
365- args := base.TestServerArgs {Knobs : base.TestingKnobs {JobsTestingKnobs : jobs .NewTestingKnobsWithShortIntervals ()}}
367+ args := base.TestServerArgs {
368+ Knobs : base.TestingKnobs {
369+ JobsTestingKnobs : jobs .NewTestingKnobsWithShortIntervals (),
370+ },
371+ DefaultTestTenant : base .TestIsSpecificToStorageLayerAndNeedsASystemTenant ,
372+ }
366373 srv , sqlDB , _ := serverutils .StartServer (t , args )
367374 execCfg := srv .ExecutorConfig ().(sql.ExecutorConfig )
368375 jobRegistry := execCfg .JobRegistry
@@ -460,7 +467,9 @@ func TestGCTenant(t *testing.T) {
460467 defer jobs .ResetConstructors ()()
461468
462469 ctx := context .Background ()
463- srv , _ , kvDB := serverutils .StartServer (t , base.TestServerArgs {})
470+ srv , _ , kvDB := serverutils .StartServer (t , base.TestServerArgs {
471+ DefaultTestTenant : base .TestIsSpecificToStorageLayerAndNeedsASystemTenant ,
472+ })
464473 execCfg := srv .ExecutorConfig ().(sql.ExecutorConfig )
465474 defer srv .Stopper ().Stop (ctx )
466475
0 commit comments