@@ -15,7 +15,6 @@ import (
1515 "github.com/cockroachdb/cockroach/pkg/jobs"
1616 "github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
1717 "github.com/cockroachdb/cockroach/pkg/jobs/jobstest"
18- "github.com/cockroachdb/cockroach/pkg/keys"
1918 "github.com/cockroachdb/cockroach/pkg/kv"
2019 "github.com/cockroachdb/cockroach/pkg/sql/catalog/catpb"
2120 "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
@@ -42,12 +41,12 @@ func TestValidateTTLScheduledJobs(t *testing.T) {
4241
4342 testCases := []struct {
4443 desc string
45- setup func (t * testing.T , sqlDB * gosql.DB , kvDB * kv.DB , s serverutils.TestServerInterface , tableDesc * tabledesc.Mutable , scheduleID jobspb.ScheduleID )
44+ setup func (t * testing.T , sqlDB * gosql.DB , kvDB * kv.DB , s serverutils.ApplicationLayerInterface , tableDesc * tabledesc.Mutable , scheduleID jobspb.ScheduleID )
4645 expectedErrRe func (tableID descpb.ID , scheduleID jobspb.ScheduleID ) string
4746 }{
4847 {
4948 desc : "not pointing at a valid scheduled job" ,
50- setup : func (t * testing.T , sqlDB * gosql.DB , kvDB * kv.DB , s serverutils.TestServerInterface , tableDesc * tabledesc.Mutable , scheduleID jobspb.ScheduleID ) {
49+ setup : func (t * testing.T , sqlDB * gosql.DB , kvDB * kv.DB , s serverutils.ApplicationLayerInterface , tableDesc * tabledesc.Mutable , scheduleID jobspb.ScheduleID ) {
5150 require .NoError (t , sqltestutils .TestingDescsTxn (ctx , s , func (ctx context.Context , txn isql.Txn , col * descs.Collection ) (err error ) {
5251 // We need the collection to read the descriptor from storage for
5352 // the subsequent write to succeed.
@@ -66,7 +65,7 @@ func TestValidateTTLScheduledJobs(t *testing.T) {
6665 },
6766 {
6867 desc : "scheduled job points at an different table" ,
69- setup : func (t * testing.T , sqlDB * gosql.DB , kvDB * kv.DB , s serverutils.TestServerInterface , tableDesc * tabledesc.Mutable , scheduleID jobspb.ScheduleID ) {
68+ setup : func (t * testing.T , sqlDB * gosql.DB , kvDB * kv.DB , s serverutils.ApplicationLayerInterface , tableDesc * tabledesc.Mutable , scheduleID jobspb.ScheduleID ) {
7069 db := s .InternalDB ().(isql.DB )
7170 require .NoError (t , db .Txn (ctx , func (ctx context.Context , txn isql.Txn ) error {
7271 schedules := jobs .ScheduledJobTxn (txn )
@@ -103,13 +102,14 @@ func TestValidateTTLScheduledJobs(t *testing.T) {
103102
104103 for _ , tc := range testCases {
105104 t .Run (tc .desc , func (t * testing.T ) {
106- s , sqlDB , kvDB := serverutils .StartServer (t , base.TestServerArgs {})
107- defer s .Stopper ().Stop (ctx )
105+ srv , sqlDB , kvDB := serverutils .StartServer (t , base.TestServerArgs {})
106+ defer srv .Stopper ().Stop (ctx )
107+ s := srv .ApplicationLayer ()
108108
109109 _ , err := sqlDB .Exec (`CREATE TABLE t () WITH (ttl_expire_after = '10 mins')` )
110110 require .NoError (t , err )
111111
112- tableDesc := desctestutils .TestingGetMutableExistingTableDescriptor (kvDB , keys . SystemSQLCodec , "defaultdb" , "t" )
112+ tableDesc := desctestutils .TestingGetMutableExistingTableDescriptor (kvDB , s . Codec () , "defaultdb" , "t" )
113113 require .NotNil (t , tableDesc .GetRowLevelTTL ())
114114 scheduleID := tableDesc .GetRowLevelTTL ().ScheduleID
115115
0 commit comments