From c8f699c9ce7ce0662934107b649d1d205078ac3f Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Tue, 3 Sep 2024 22:39:17 +0800 Subject: [PATCH] chore: cleanup --- internal/cluster/clutser_test.go | 10 +++++----- internal/cluster/plugin_test.go | 4 ++-- internal/cluster/redirect_test.go | 2 +- internal/cluster/vote_test.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/cluster/clutser_test.go b/internal/cluster/clutser_test.go index 1ecdf5d..2ca4fcd 100644 --- a/internal/cluster/clutser_test.go +++ b/internal/cluster/clutser_test.go @@ -35,7 +35,7 @@ func createSimulationCluster(nums int) ([]*Cluster, error) { return result, nil } -func launchSimulationCluster(clusters []*Cluster, t *testing.T) { +func launchSimulationCluster(clusters []*Cluster) { for _, cluster := range clusters { cluster.Launch() } @@ -61,7 +61,7 @@ func TestSingleClusterLifetime(t *testing.T) { t.Errorf("create simulation cluster failed: %v", err) return } - launchSimulationCluster(clusters, t) + launchSimulationCluster(clusters) defer closeSimulationCluster(clusters, t) <-clusters[0].NotifyBecomeMaster() @@ -79,7 +79,7 @@ func TestMultipleClusterLifetime(t *testing.T) { t.Errorf("create simulation cluster failed: %v", err) return } - launchSimulationCluster(clusters, t) + launchSimulationCluster(clusters) defer closeSimulationCluster(clusters, t) select { @@ -118,7 +118,7 @@ func TestClusterSubstituteMaster(t *testing.T) { t.Errorf("create simulation cluster failed: %v", err) return } - launchSimulationCluster(clusters, t) + launchSimulationCluster(clusters) defer closeSimulationCluster(clusters, t) select { @@ -176,7 +176,7 @@ func TestClusterAutoGCNoLongerActiveNode(t *testing.T) { t.Errorf("create simulation cluster failed: %v", err) return } - launchSimulationCluster(clusters, t) + launchSimulationCluster(clusters) defer closeSimulationCluster(clusters, t) select { diff --git a/internal/cluster/plugin_test.go b/internal/cluster/plugin_test.go index 947c78e..7cfb281 100644 --- a/internal/cluster/plugin_test.go +++ b/internal/cluster/plugin_test.go @@ -66,7 +66,7 @@ func TestPluginScheduleLifetime(t *testing.T) { return } - launchSimulationCluster(cluster, t) + launchSimulationCluster(cluster) defer closeSimulationCluster(cluster, t) time.Sleep(time.Second * 1) @@ -131,7 +131,7 @@ func TestPluginScheduleWhenMasterClusterShutdown(t *testing.T) { return } - launchSimulationCluster(cluster, t) + launchSimulationCluster(cluster) defer closeSimulationCluster(cluster, t) // add plugin to the cluster diff --git a/internal/cluster/redirect_test.go b/internal/cluster/redirect_test.go index 294f1cf..45f7ca7 100644 --- a/internal/cluster/redirect_test.go +++ b/internal/cluster/redirect_test.go @@ -127,7 +127,7 @@ func TestRedirectTraffic(t *testing.T) { } // launch cluster - launchSimulationCluster(cluster, t) + launchSimulationCluster(cluster) defer closeSimulationCluster(cluster, t) // wait for all nodes to be ready diff --git a/internal/cluster/vote_test.go b/internal/cluster/vote_test.go index 0035f47..a563c61 100644 --- a/internal/cluster/vote_test.go +++ b/internal/cluster/vote_test.go @@ -60,7 +60,7 @@ func TestVoteAddresses(t *testing.T) { }() } - launchSimulationCluster(cluster, t) + launchSimulationCluster(cluster) defer closeSimulationCluster(cluster, t) // wait for all nodes to be ready