From d818ca963178a11748aa6267136ad2d6eb1de5e5 Mon Sep 17 00:00:00 2001 From: zehweh Date: Tue, 21 Nov 2023 14:05:35 +0100 Subject: [PATCH] fix TestMisplacedChecking() and add test-case --- weed/shell/command_volume_fix_replication_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/weed/shell/command_volume_fix_replication_test.go b/weed/shell/command_volume_fix_replication_test.go index 89ab9f0c1..97f270306 100644 --- a/weed/shell/command_volume_fix_replication_test.go +++ b/weed/shell/command_volume_fix_replication_test.go @@ -332,7 +332,10 @@ func TestMisplacedChecking(t *testing.T) { location: &location{"dc1", "r1", &master_pb.DataNodeInfo{Id: "dn1"}}, }, { - location: &location{"dc1", "r2", &master_pb.DataNodeInfo{Id: "dn2"}}, + location: &location{"dc1", "r1", &master_pb.DataNodeInfo{Id: "dn2"}}, + }, + { + location: &location{"dc1", "r2", &master_pb.DataNodeInfo{Id: "dn3"}}, }, }, expected: false, @@ -345,10 +348,13 @@ func TestMisplacedChecking(t *testing.T) { location: &location{"dc1", "r1", &master_pb.DataNodeInfo{Id: "dn1"}}, }, { - location: &location{"dc1", "r2", &master_pb.DataNodeInfo{Id: "dn2"}}, + location: &location{"dc1", "r1", &master_pb.DataNodeInfo{Id: "dn2"}}, + }, + { + location: &location{"dc2", "r2", &master_pb.DataNodeInfo{Id: "dn3"}}, }, }, - expected: false, + expected: true, }, { name: "test 100",