nickva commented on code in PR #5473:
URL: https://github.com/apache/couchdb/pull/5473#discussion_r1992295133


##########
src/fabric/src/fabric_doc_open.erl:
##########
@@ -230,67 +230,65 @@ open_doc_test_() ->
             fun setup/0,
             fun teardown/1,
             [
-                t_is_r_met(),
-                t_handle_message_down(),
-                t_handle_message_exit(),
-                t_handle_message_reply(),
-                t_store_node_revs(),
-                t_read_repair(),
-                t_no_read_repair_for_replicator(),
-                t_handle_response_quorum_met(),
-                t_get_doc_info()
+                ?TDEF_FE(t_is_r_met),
+                ?TDEF_FE(t_handle_message_down),
+                ?TDEF_FE(t_handle_message_exit),
+                ?TDEF_FE(t_handle_message_reply),
+                ?TDEF_FE(t_store_node_revs),
+                ?TDEF_FE(t_read_repair),
+                ?TDEF_FE(t_no_read_repair_for_replicator),
+                ?TDEF_FE(t_handle_response_quorum_met),
+                ?TDEF_FE(t_get_doc_info)
             ]
         }
     }.
 
-t_is_r_met() ->
-    ?_test(begin
-        Workers0 = [],
-        Workers1 = [nil],
-        Workers2 = [nil, nil],
-
-        SuccessCases = [
-            {{true, foo}, [fabric_util:kv(foo, 2)], 2},
-            {{true, foo}, [fabric_util:kv(foo, 3)], 2},
-            {{true, foo}, [fabric_util:kv(foo, 1)], 1},
-            {{true, foo}, [fabric_util:kv(foo, 2), fabric_util:kv(bar, 1)], 2},
-            {{true, bar}, [fabric_util:kv(bar, 1), fabric_util:kv(bar, 2)], 2},
-            {{true, bar}, [fabric_util:kv(bar, 2), fabric_util:kv(foo, 1)], 2}
-        ],
-        lists:foreach(
-            fun({Expect, Replies, Q}) ->
-                ?assertEqual(Expect, is_r_met(Workers0, Replies, Q))
-            end,
-            SuccessCases
-        ),
-
-        WaitForMoreCases = [
-            {[fabric_util:kv(foo, 1)], 2},
-            {[fabric_util:kv(foo, 2)], 3},
-            {[fabric_util:kv(foo, 1), fabric_util:kv(bar, 1)], 2}
-        ],
-        lists:foreach(
-            fun({Replies, Q}) ->
-                ?assertEqual(wait_for_more, is_r_met(Workers2, Replies, Q))
-            end,
-            WaitForMoreCases
-        ),
-
-        FailureCases = [
-            {Workers0, [fabric_util:kv(foo, 1)], 2},
-            {Workers1, [fabric_util:kv(foo, 1)], 2},
-            {Workers1, [fabric_util:kv(foo, 1), fabric_util:kv(bar, 1)], 2},
-            {Workers1, [fabric_util:kv(foo, 2)], 3}
-        ],
-        lists:foreach(
-            fun({Workers, Replies, Q}) ->
-                ?assertEqual(no_more_workers, is_r_met(Workers, Replies, Q))
-            end,
-            FailureCases
-        )
-    end).
+t_is_r_met(_) ->

Review Comment:
   Excellent cleanup!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to