Skip to content

Commit

Permalink
spanconfigtestutils: copy gc job testing knobs to tenant
Browse files Browse the repository at this point in the history
Some of the sqltranslator tests require that we can disable the GC job
related to an index creation so that we can observe the span
configuration on the temporary indexes.  We pause the GC job via a
testing knob.

Release justification: Test-only change

Release note: None
  • Loading branch information
stevendanna committed Aug 22, 2022
1 parent a50a783 commit afe6c41
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ func (h *Handle) InitializeTenant(ctx context.Context, tenID roachpb.TenantID) *
tenantState.db = sqlutils.MakeSQLRunner(h.tc.ServerConn(0))
tenantState.cleanup = func() {} // noop
} else {
serverGCJobKnobs := testServer.TestingKnobs().GCJob
tenantGCJobKnobs := sql.GCJobTestingKnobs{SkipWaitingForMVCCGC: true}
if serverGCJobKnobs != nil {
tenantGCJobKnobs = *serverGCJobKnobs.(*sql.GCJobTestingKnobs)
tenantGCJobKnobs.SkipWaitingForMVCCGC = true
}
tenantArgs := base.TestTenantArgs{
TenantID: tenID,
TestingKnobs: base.TestingKnobs{
SpanConfig: h.scKnobs,
GCJob: &sql.GCJobTestingKnobs{
SkipWaitingForMVCCGC: true,
},
GCJob: &tenantGCJobKnobs,
},
}
var err error
Expand Down

0 comments on commit afe6c41

Please sign in to comment.