Skip to content

Commit

Permalink
roachtest: use longer upgrade timeout in backup-restore/mixed-version
Browse files Browse the repository at this point in the history
Informs: cockroachdb#107414

Release note: None
  • Loading branch information
renatolabs committed Jul 26, 2023
1 parent 8620ff4 commit de9539a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func WaitForClusterUpgrade(
return nil
}

l.Printf("waiting for cluster to auto-upgrade to %s", newVersion)
l.Printf("waiting for cluster to auto-upgrade to %s for %s", newVersion, timeout)
if err := waitForUpgrade(firstNode, timeout); err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/roachtest/roachtestutil/mixedversion/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func (p *testPlanner) initSteps() []testStep {
// nodes to be the same and then run any after-finalization hooks the
// user may have provided.
func (p *testPlanner) finalSteps() []testStep {
fmt.Printf(">>>> option timeout: %s\n", p.options.upgradeTimeout)
return append([]testStep{
waitForStableClusterVersionStep{id: p.nextID(), nodes: p.crdbNodes, timeout: p.options.upgradeTimeout},
}, p.hooks.AfterUpgradeFinalizedSteps(p.nextID, p.finalContext(false /* finalizing */))...)
Expand Down
7 changes: 3 additions & 4 deletions pkg/cmd/roachtest/roachtestutil/mixedversion/planner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,15 @@ func Test_startClusterID(t *testing.T) {
// timeout in the clusterupgrade package is used; otherwise, the
// custom value is enforced.
func Test_upgradeTimeout(t *testing.T) {
findUpgradeWaitStep := func(plan *TestPlan) []waitForStableClusterVersionStep {
var zero waitForStableClusterVersionStep
findUpgradeWaitSteps := func(plan *TestPlan) []waitForStableClusterVersionStep {
var steps []waitForStableClusterVersionStep
for _, s := range plan.steps {
if step, isUpgrade := s.(waitForStableClusterVersionStep); isUpgrade {
steps = append(steps, step)
}
}
if len(steps) == 0 {
require.Fail(t, "could not find any %T step in the plan", zero)
require.Fail(t, "could not find any waitForStableClusterVersionStep in the plan")
}
return steps
}
Expand All @@ -282,7 +281,7 @@ func Test_upgradeTimeout(t *testing.T) {
mvt := newTest(opts...)
plan, err := mvt.plan()
require.NoError(t, err)
waitUpgrades := findUpgradeWaitStep(plan)
waitUpgrades := findUpgradeWaitSteps(plan)

for _, s := range waitUpgrades {
require.Equal(t, expectedTimeout, s.timeout)
Expand Down
9 changes: 8 additions & 1 deletion pkg/cmd/roachtest/tests/mixed_version_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,14 @@ func registerBackupMixedVersion(r registry.Registry) {

roachNodes := c.Range(1, c.Spec().NodeCount-1)
workloadNode := c.Node(c.Spec().NodeCount)
mvt := mixedversion.NewTest(ctx, t, t.L(), c, roachNodes)
mvt := mixedversion.NewTest(
ctx, t, t.L(), c, roachNodes,
// We use a longer upgrade timeout in this test to give the
// migrations enough time to finish considering all the data
// that might exist in the cluster by the time the upgrade is
// attempted.
mixedversion.UpgradeTimeout(30*time.Minute),
)
testRNG := mvt.RNG()

uploadVersion(ctx, t, c, workloadNode, clusterupgrade.MainVersion)
Expand Down

0 comments on commit de9539a

Please sign in to comment.