diff --git a/tests/e2e/cluster_downgrade_test.go b/tests/e2e/cluster_downgrade_test.go index 90beff206da5..8b6b967fe6b1 100644 --- a/tests/e2e/cluster_downgrade_test.go +++ b/tests/e2e/cluster_downgrade_test.go @@ -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) { @@ -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) { @@ -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)