aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-08-12 09:30:42 -0700
committerchrislu <chris.lu@gmail.com>2024-08-12 09:30:42 -0700
commitff661553025bd283a9f4f3f412e9fc1f8e6fbaf6 (patch)
treead175f50870bea8bd39458f8c958570c59fdc418
parent83fe2bfc3665d94462f6ed07459b58eaedc30df6 (diff)
downloadseaweedfs-ff661553025bd283a9f4f3f412e9fc1f8e6fbaf6.tar.xz
seaweedfs-ff661553025bd283a9f4f3f412e9fc1f8e6fbaf6.zip
fix tests
-rw-r--r--weed/mq/pub_balancer/allocate_test.go58
1 files changed, 6 insertions, 52 deletions
diff --git a/weed/mq/pub_balancer/allocate_test.go b/weed/mq/pub_balancer/allocate_test.go
index 7e7a09dab..4b36af388 100644
--- a/weed/mq/pub_balancer/allocate_test.go
+++ b/weed/mq/pub_balancer/allocate_test.go
@@ -97,9 +97,7 @@ func TestEnsureAssignmentsToActiveBrokersX(t *testing.T) {
{
LeaderBroker: "",
Partition: &mq_pb.Partition{},
- FollowerBrokers: []string{
- "localhost:2",
- },
+ FollowerBroker: "localhost:2",
},
},
},
@@ -114,9 +112,7 @@ func TestEnsureAssignmentsToActiveBrokersX(t *testing.T) {
{
LeaderBroker: "localhost:1",
Partition: &mq_pb.Partition{},
- FollowerBrokers: []string{
- "",
- },
+ FollowerBroker: "",
},
},
},
@@ -131,9 +127,7 @@ func TestEnsureAssignmentsToActiveBrokersX(t *testing.T) {
{
LeaderBroker: "localhost:1",
Partition: &mq_pb.Partition{},
- FollowerBrokers: []string{
- "localhost:200",
- },
+ FollowerBroker: "localhost:200",
},
},
},
@@ -148,43 +142,7 @@ func TestEnsureAssignmentsToActiveBrokersX(t *testing.T) {
{
LeaderBroker: "localhost:100",
Partition: &mq_pb.Partition{},
- FollowerBrokers: []string{
- "localhost:200",
- },
- },
- },
- },
- hasChanges: true,
- },
- {
- name: "test missing two followers",
- args: args{
- activeBrokers: activeBrokers,
- followerCount: 3,
- assignments: []*mq_pb.BrokerPartitionAssignment{
- {
- LeaderBroker: "localhost:1",
- Partition: &mq_pb.Partition{},
- FollowerBrokers: []string{
- "localhost:2",
- },
- },
- },
- },
- hasChanges: true,
- },
- {
- name: "test missing some followers",
- args: args{
- activeBrokers: activeBrokers,
- followerCount: 10,
- assignments: []*mq_pb.BrokerPartitionAssignment{
- {
- LeaderBroker: "localhost:1",
- Partition: &mq_pb.Partition{},
- FollowerBrokers: []string{
- "localhost:2",
- },
+ FollowerBroker: "localhost:200",
},
},
},
@@ -199,9 +157,7 @@ func TestEnsureAssignmentsToActiveBrokersX(t *testing.T) {
{
LeaderBroker: "localhost:1",
Partition: &mq_pb.Partition{},
- FollowerBrokers: []string{
- "localhost:2",
- },
+ FollowerBroker: "localhost:2",
},
},
},
@@ -230,9 +186,7 @@ func TestEnsureAssignmentsToActiveBrokersX(t *testing.T) {
{
LeaderBroker: "localhost:1",
Partition: &mq_pb.Partition{},
- FollowerBrokers: []string{
- "localhost:2",
- },
+ FollowerBroker: "localhost:2",
},
},
},