Skip to content

Commit

Permalink
Rename cancellationSize to numberOfMembersToDowngrade, and set it 0 f…
Browse files Browse the repository at this point in the history
…or cases like cancelRightAfterEnable

Signed-off-by: Chun-Hung Tseng <[email protected]>
  • Loading branch information
Chun-Hung Tseng committed Jan 29, 2025
1 parent 412bb69 commit 01690d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/e2e/cluster_downgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ func TestDowngradeUpgradeClusterOf3WithSnapshot(t *testing.T) {
}

func TestDowngradeCancellationWithoutEnablingClusterOf1(t *testing.T) {
testDowngradeUpgrade(t, 1, 1, false, cancelRightBeforeEnable)
testDowngradeUpgrade(t, 0, 1, false, cancelRightBeforeEnable)
}

func TestDowngradeCancellationRightAfterEnablingClusterOf1(t *testing.T) {
testDowngradeUpgrade(t, 1, 1, false, cancelRightAfterEnable)
testDowngradeUpgrade(t, 0, 1, false, cancelRightAfterEnable)
}

func TestDowngradeCancellationWithoutEnablingClusterOf3(t *testing.T) {
testDowngradeUpgrade(t, 3, 3, false, cancelRightBeforeEnable)
testDowngradeUpgrade(t, 0, 3, false, cancelRightBeforeEnable)
}

func TestDowngradeCancellationRightAfterEnablingClusterOf3(t *testing.T) {
testDowngradeUpgrade(t, 3, 3, false, cancelRightAfterEnable)
testDowngradeUpgrade(t, 0, 3, false, cancelRightAfterEnable)
}

func TestDowngradeCancellationAfterDowngrading1InClusterOf3(t *testing.T) {
Expand All @@ -88,7 +88,7 @@ func TestDowngradeCancellationAfterDowngrading2InClusterOf3(t *testing.T) {
testDowngradeUpgrade(t, 2, 3, false, cancelAfterDowngrading)
}

func testDowngradeUpgrade(t *testing.T, cancellationSize int, clusterSize int, triggerSnapshot bool, triggerCancellation CancellationState) {
func testDowngradeUpgrade(t *testing.T, numberOfMembersToDowngrade int, clusterSize int, triggerSnapshot bool, triggerCancellation CancellationState) {
currentEtcdBinary := e2e.BinPath.Etcd
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
if !fileutil.Exist(lastReleaseBinary) {
Expand Down Expand Up @@ -159,7 +159,7 @@ func testDowngradeUpgrade(t *testing.T, cancellationSize int, clusterSize int, t
return // No need to perform downgrading, end the test here
}

membersToChange := rand.Perm(len(epc.Procs))[:cancellationSize]
membersToChange := rand.Perm(len(epc.Procs))[:numberOfMembersToDowngrade]
t.Logf(fmt.Sprintln("Elect members for operations"), zap.Any("members", membersToChange))

t.Logf("Starting downgrade process to %q", lastVersionStr)
Expand Down

0 comments on commit 01690d8

Please sign in to comment.