diff --git a/pkg/cmd/roachtest/tests/BUILD.bazel b/pkg/cmd/roachtest/tests/BUILD.bazel index a39b24951e66..ffb6016001d7 100644 --- a/pkg/cmd/roachtest/tests/BUILD.bazel +++ b/pkg/cmd/roachtest/tests/BUILD.bazel @@ -227,6 +227,7 @@ go_library( "//pkg/cmd/roachtest/roachtestutil", "//pkg/cmd/roachtest/roachtestutil/clusterupgrade", "//pkg/cmd/roachtest/roachtestutil/mixedversion", + "//pkg/cmd/roachtest/roachtestutil/task", "//pkg/cmd/roachtest/spec", "//pkg/cmd/roachtest/test", "//pkg/gossip", diff --git a/pkg/cmd/roachtest/tests/backup_restore_roundtrip.go b/pkg/cmd/roachtest/tests/backup_restore_roundtrip.go index 8c0afca3d5fc..2a9831bbefe0 100644 --- a/pkg/cmd/roachtest/tests/backup_restore_roundtrip.go +++ b/pkg/cmd/roachtest/tests/backup_restore_roundtrip.go @@ -167,7 +167,7 @@ func backupRestoreRoundTrip( // Run backups. t.L().Printf("starting backup %d", i+1) collection, err := d.createBackupCollection( - ctx, t.L(), testRNG, bspec, bspec, "round-trip-test-backup", + ctx, t.L(), t, testRNG, bspec, bspec, "round-trip-test-backup", true /* internalSystemsJobs */, false, /* isMultitenant */ ) if err != nil { diff --git a/pkg/cmd/roachtest/tests/mixed_version_backup.go b/pkg/cmd/roachtest/tests/mixed_version_backup.go index 41a87ad3ec41..cd5cceabe389 100644 --- a/pkg/cmd/roachtest/tests/mixed_version_backup.go +++ b/pkg/cmd/roachtest/tests/mixed_version_backup.go @@ -28,6 +28,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/clusterupgrade" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/mixedversion" + "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/task" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/spec" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test" "github.com/cockroachdb/cockroach/pkg/jobs" @@ -1826,6 +1827,7 @@ func (d *BackupRestoreTestDriver) saveContents( func (d *BackupRestoreTestDriver) runBackup( ctx context.Context, l *logger.Logger, + tasker task.Tasker, rng *rand.Rand, nodes option.NodeListOption, pauseProbability float64, @@ -1890,13 +1892,14 @@ func (d *BackupRestoreTestDriver) runBackup( } backupErr := make(chan error) - go func() { + tasker.Go(func(ctx context.Context, l *logger.Logger) error { defer close(backupErr) l.Printf("waiting for job %d (%s)", jobID, collection.name) if err := d.testUtils.waitForJobSuccess(ctx, l, rng, jobID, internalSystemJobs); err != nil { backupErr <- err } - }() + return nil + }) var numPauses int for { @@ -1995,7 +1998,7 @@ func (mvb *mixedVersionBackup) createBackupCollection( } collection, err := mvb.backupRestoreTestDriver.createBackupCollection( - ctx, l, rng, fullBackupSpec, incBackupSpec, backupNamePrefix, + ctx, l, h, rng, fullBackupSpec, incBackupSpec, backupNamePrefix, internalSystemJobs, h.IsMultitenant(), ) if err != nil { @@ -2014,6 +2017,7 @@ func (mvb *mixedVersionBackup) createBackupCollection( func (d *BackupRestoreTestDriver) createBackupCollection( ctx context.Context, l *logger.Logger, + tasker task.Tasker, rng *rand.Rand, fullBackupSpec backupSpec, incBackupSpec backupSpec, @@ -2029,7 +2033,7 @@ func (d *BackupRestoreTestDriver) createBackupCollection( if err := d.testUtils.runJobOnOneOf(ctx, l, fullBackupSpec.Execute.Nodes, func() error { var err error collection, fullBackupEndTime, err = d.runBackup( - ctx, l, rng, fullBackupSpec.Plan.Nodes, fullBackupSpec.PauseProbability, + ctx, l, tasker, rng, fullBackupSpec.Plan.Nodes, fullBackupSpec.PauseProbability, fullBackup{backupNamePrefix}, internalSystemJobs, isMultitenant, ) return err @@ -2051,7 +2055,7 @@ func (d *BackupRestoreTestDriver) createBackupCollection( if err := d.testUtils.runJobOnOneOf(ctx, l, incBackupSpec.Execute.Nodes, func() error { var err error collection, latestIncBackupEndTime, err = d.runBackup( - ctx, l, rng, incBackupSpec.Plan.Nodes, incBackupSpec.PauseProbability, + ctx, l, tasker, rng, incBackupSpec.Plan.Nodes, incBackupSpec.PauseProbability, incrementalBackup{collection: collection, incNum: i + 1}, internalSystemJobs, isMultitenant, ) return err