diff --git a/pkg/sql/schemachanger/BUILD.bazel b/pkg/sql/schemachanger/BUILD.bazel index 111eb6a546d3..10950abfc197 100644 --- a/pkg/sql/schemachanger/BUILD.bazel +++ b/pkg/sql/schemachanger/BUILD.bazel @@ -57,6 +57,7 @@ go_test( "//pkg/sql/schemachanger/scop", "//pkg/sql/schemachanger/scplan", "//pkg/sql/schemachanger/sctest", # keep + "//pkg/sql/sem/eval", "//pkg/sql/sessiondatapb", "//pkg/testutils", "//pkg/testutils/serverutils", diff --git a/pkg/sql/schemachanger/dml_injection_test.go b/pkg/sql/schemachanger/dml_injection_test.go index 88b03d5eb997..0020b1e02d4e 100644 --- a/pkg/sql/schemachanger/dml_injection_test.go +++ b/pkg/sql/schemachanger/dml_injection_test.go @@ -17,6 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan" + "github.com/cockroachdb/cockroach/pkg/sql/sem/eval" "github.com/cockroachdb/cockroach/pkg/testutils/serverutils" "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" @@ -457,6 +458,11 @@ func TestAlterTableDMLInjection(t *testing.T) { testCluster := serverutils.StartCluster(t, 1, base.TestClusterArgs{ ServerArgs: base.TestServerArgs{ Knobs: base.TestingKnobs{ + SQLEvalContext: &eval.TestingKnobs{ + // We disable the randomization of some batch sizes because with + // some low values the test takes much longer. + ForceProductionValues: true, + }, SQLDeclarativeSchemaChanger: &scexec.TestingKnobs{ BeforeStage: func(p scplan.Plan, stageIdx int) error { if !clusterCreated.Load() {