This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch auto-delete-3-plus-shard-move
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 3f93d6d032e1adeece62afeb5318fe7b4f585983
Author: Robert Newson <[email protected]>
AuthorDate: Thu Jun 12 12:56:10 2025 +0100

    expand splits test
---
 src/fabric/src/fabric_drop_seq.erl | 41 ++++++++++++++++++++++++++++----------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/src/fabric/src/fabric_drop_seq.erl 
b/src/fabric/src/fabric_drop_seq.erl
index f01bc3fee..c22cd909b 100644
--- a/src/fabric/src/fabric_drop_seq.erl
+++ b/src/fabric/src/fabric_drop_seq.erl
@@ -746,22 +746,43 @@ fully_replicated_shards_only_test_() ->
         )
     ].
 
-substitute_splits_test() ->
+substitute_splits_test_() ->
     Range = [0, 10],
-    Subrange1 = [0, 5],
-    Subrange2 = [6, 10],
     Node1 = '[email protected]',
-    Shards = [#shard{range = Subrange1, node = Node1}, #shard{range = 
Subrange2, node = Node1}],
     UuidMap = #{
-        {Subrange1, Node1} => <<"uuid2">>,
-        {Subrange2, Node1} => <<"uuid3">>
+        {[0, 5], Node1} => <<"uuid2">>,
+        {[6, 10], Node1} => <<"uuid3">>,
+        {[0, 3], Node1} => <<"uuid4">>,
+        {[4, 5], Node1} => <<"uuid5">>
     },
     PeerCheckpoints = #{{Range, Node1} => {<<"uuid1">>, 12}},
 
-    ?assertEqual(
-        #{{Subrange1, Node1} => {<<"uuid2">>, 12}, {Subrange2, Node1} => 
{<<"uuid3">>, 12}},
-        substitute_splits(Shards, UuidMap, PeerCheckpoints)
-    ).
+    [
+        ?_assertEqual(
+            #{{[0, 5], Node1} => {<<"uuid2">>, 12}, {[6, 10], Node1} => 
{<<"uuid3">>, 12}},
+            substitute_splits(
+                [#shard{range = [0, 5], node = Node1}, #shard{range = [6, 10], 
node = Node1}],
+                UuidMap,
+                PeerCheckpoints
+            )
+        ),
+        ?_assertEqual(
+            #{
+                {[0, 3], Node1} => {<<"uuid4">>, 12},
+                {[4, 5], Node1} => {<<"uuid5">>, 12},
+                {[6, 10], Node1} => {<<"uuid3">>, 12}
+            },
+            substitute_splits(
+                [
+                    #shard{range = [0, 3], node = Node1},
+                    #shard{range = [4, 5], node = Node1},
+                    #shard{range = [6, 10], node = Node1}
+                ],
+                UuidMap,
+                PeerCheckpoints
+            )
+        )
+    ].
 
 crossref_test_() ->
     Range = [0, 10],

Reply via email to