Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
100873: upgrademanager: audit tests that use MakeTestingClusterSettingsWithVersions r=rafiss a=rafiss

informs cockroachdb#100552

Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
craig[bot] and rafiss committed Apr 7, 2023
2 parents b24202e + 96bcb4d commit 8e6f530
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/upgrade/upgrademanager/manager_external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,19 @@ func TestMigrateUpdatesReplicaVersion(t *testing.T) {
defer log.Scope(t).Close(t)

// We're going to be migrating from startCV to endCV.
startCV := roachpb.Version{Major: 41}
endCV := roachpb.Version{Major: 42}
startCVKey := clusterversion.V22_2
startCV := clusterversion.ByKey(startCVKey)
endCVKey := startCVKey + 1
endCV := clusterversion.ByKey(endCVKey)

var desc roachpb.RangeDescriptor
ctx := context.Background()
tc := testcluster.StartTestCluster(t, 2, base.TestClusterArgs{
ReplicationMode: base.ReplicationManual,
ServerArgs: base.TestServerArgs{
Settings: cluster.MakeTestingClusterSettingsWithVersions(endCV, startCV, false),
Knobs: base.TestingKnobs{
Server: &server.TestingKnobs{
BootstrapVersionKeyOverride: clusterversion.BinaryMinSupportedVersionKey,
BinaryVersionOverride: startCV,
DisableAutomaticVersionUpgrade: make(chan struct{}),
},
Expand Down Expand Up @@ -320,12 +322,12 @@ func TestConcurrentMigrationAttempts(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

// We're going to be migrating from the current version to imaginary future versions.
current := clusterversion.ByKey(clusterversion.BinaryVersionKey)
// We're going to be migrating from the BinaryMinSupportedVersion to imaginary future versions.
current := clusterversion.TestingBinaryMinSupportedVersion
versions := []roachpb.Version{current}
for i := int32(1); i <= 6; i++ {
for i := int32(1); i <= 5; i++ {
v := current
v.Major += i
v.Internal += i * 2
versions = append(versions, v)
}

Expand Down

0 comments on commit 8e6f530

Please sign in to comment.