Skip to content

Commit

Permalink
backupccl: fix occassional TestRestoreErrorPropagates flake
Browse files Browse the repository at this point in the history
Very rarely under stress race another automatic job would
race with the restore and increment the error count. This would
result in the count being greater than our expected value of 1.
This disables all the automatic jobs eliminating the chance of this
race.

Fixes: #98037

Release note: None
  • Loading branch information
adityamaru committed Mar 17, 2023
1 parent 1352ad2 commit 0b9e6bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/ccl/backupccl/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
"github.com/cockroachdb/cockroach/pkg/jobs/jobstest"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/keyvisualizer"
"github.com/cockroachdb/cockroach/pkg/kv"
"github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord"
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
Expand Down Expand Up @@ -6204,11 +6205,16 @@ func TestRestoreErrorPropagates(t *testing.T) {
return nil
},
}
params.ServerArgs.Knobs.JobsTestingKnobs = jobs.NewTestingKnobsWithShortIntervals()
params.ServerArgs.Knobs.KeyVisualizer = &keyvisualizer.TestingKnobs{SkipJobBootstrap: true}
params.ServerArgs.DisableSpanConfigs = true
tc := testcluster.StartTestCluster(t, 3, params)
defer tc.Stopper().Stop(ctx)
db := tc.ServerConn(0)
runner := sqlutils.MakeSQLRunner(db)
runner.Exec(t, `SET CLUSTER SETTING jobs.metrics.interval.poll = '30s'`)
runner.Exec(t, `SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false`)
runner.Exec(t, `SET CLUSTER SETTING sql.stats.system_tables_autostats.enabled = false`)
runner.Exec(t, "CREATE TABLE foo ()")
runner.Exec(t, "CREATE DATABASE into_db")
url := `nodelocal://0/foo`
Expand Down

0 comments on commit 0b9e6bb

Please sign in to comment.