Skip to content

Commit 2d34092

Browse files
committed
schemachanger: attempt to deflake schemachanger integration tests
We are seeing more timeouts in the tests. This patch attempts to deflake the test by forcing production values for constants and settings, rather than using metamorphic settings. It also skips more tests under deadlock, which were already skipped under race. Release note: None
1 parent d94e350 commit 2d34092

File tree

7 files changed

+16
-0
lines changed

7 files changed

+16
-0
lines changed

pkg/ccl/schemachangerccl/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ go_library(
2020
"//pkg/sql",
2121
"//pkg/sql/schemachanger/scexec",
2222
"//pkg/sql/schemachanger/sctest",
23+
"//pkg/sql/sem/eval",
2324
"//pkg/testutils/serverutils",
2425
],
2526
)

pkg/ccl/schemachangerccl/multiregion_testcluster_factory.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/cockroachdb/cockroach/pkg/sql"
2020
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec"
2121
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/sctest"
22+
"github.com/cockroachdb/cockroach/pkg/sql/sem/eval"
2223
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
2324
)
2425

@@ -61,6 +62,9 @@ func (f MultiRegionTestClusterFactory) Run(
6162
) {
6263
const numServers = 3
6364
knobs := base.TestingKnobs{
65+
SQLEvalContext: &eval.TestingKnobs{
66+
ForceProductionValues: true,
67+
},
6468
JobsTestingKnobs: jobs.NewTestingKnobsWithShortIntervals(),
6569
SQLExecutor: &sql.ExecutorTestingKnobs{
6670
UseTransactionalDescIDGenerator: true,

pkg/sql/schemachanger/sctest/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ go_library(
4343
"//pkg/sql/schemachanger/scplan/scviz",
4444
"//pkg/sql/schemachanger/screl",
4545
"//pkg/sql/schemachanger/scrun",
46+
"//pkg/sql/sem/eval",
4647
"//pkg/sql/sem/tree",
4748
"//pkg/sql/sessiondata",
4849
"//pkg/sql/sessiondatapb",

pkg/sql/schemachanger/sctest/cumulative.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func Rollback(t *testing.T, relPath string, factory TestServerFactory) {
3636
// These tests are expensive.
3737
skip.UnderStress(t)
3838
skip.UnderRace(t)
39+
skip.UnderDeadlock(t)
3940

4041
testRollbackCase := func(t *testing.T, cs CumulativeTestCaseSpec) {
4142
if cs.Phase != scop.PostCommitPhase {
@@ -282,6 +283,7 @@ func GenerateSchemaChangeCorpus(t *testing.T, path string, factory TestServerFac
282283
// These tests are expensive.
283284
skip.UnderStress(t)
284285
skip.UnderRace(t)
286+
skip.UnderDeadlock(t)
285287

286288
if corpusPath == "" {
287289
skip.IgnoreLintf(t, "requires declarative-corpus path parameter")
@@ -329,6 +331,7 @@ func Pause(t *testing.T, path string, factory TestServerFactory) {
329331
// These tests are expensive.
330332
skip.UnderStress(t)
331333
skip.UnderRace(t)
334+
skip.UnderDeadlock(t)
332335

333336
cumulativeTestForEachPostCommitStage(t, path, factory, func(t *testing.T, cs CumulativeTestCaseSpec) {
334337
pause(t, factory, cs)
@@ -341,6 +344,7 @@ func PauseMixedVersion(t *testing.T, path string, factory TestServerFactory) {
341344
// These tests are expensive.
342345
skip.UnderStress(t)
343346
skip.UnderRace(t)
347+
skip.UnderDeadlock(t)
344348

345349
factory.WithMixedVersion()
346350
cumulativeTestForEachPostCommitStage(t, path, factory, func(t *testing.T, cs CumulativeTestCaseSpec) {

pkg/sql/schemachanger/sctest/decomp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func DecomposeToElements(t *testing.T, dir string, factory TestServerFactory) {
3636
// These tests are expensive.
3737
skip.UnderRace(t)
3838
skip.UnderStress(t)
39+
skip.UnderDeadlock(t)
3940

4041
ctx := context.Background()
4142
datadriven.Walk(t, dir, func(t *testing.T, path string) {

pkg/sql/schemachanger/sctest/end_to_end.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func EndToEndSideEffects(t *testing.T, relTestCaseDir string, factory TestServer
5858
// These tests are expensive.
5959
skip.UnderStress(t)
6060
skip.UnderRace(t)
61+
skip.UnderDeadlock(t)
6162

6263
ctx := context.Background()
6364
testCaseDir := datapathutils.RewritableDataPath(t, relTestCaseDir)

pkg/sql/schemachanger/sctest/test_server_factory.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
1919
"github.com/cockroachdb/cockroach/pkg/sql"
2020
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec"
21+
"github.com/cockroachdb/cockroach/pkg/sql/sem/eval"
2122
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
2223
"github.com/cockroachdb/cockroach/pkg/util/log"
2324
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
@@ -88,6 +89,9 @@ func (f SingleNodeTestClusterFactory) Run(
8889
) {
8990
args := base.TestServerArgs{
9091
Knobs: base.TestingKnobs{
92+
SQLEvalContext: &eval.TestingKnobs{
93+
ForceProductionValues: true,
94+
},
9195
JobsTestingKnobs: newJobsKnobs(),
9296
SQLExecutor: &sql.ExecutorTestingKnobs{
9397
UseTransactionalDescIDGenerator: true,

0 commit comments

Comments
 (0)