diff --git a/tests/verify_counter_repl.erl b/tests/verify_counter_repl.erl index 7e1a282c..f16e83ea 100644 --- a/tests/verify_counter_repl.erl +++ b/tests/verify_counter_repl.erl @@ -51,12 +51,10 @@ confirm() -> %% let the repl flow repl_power_activate(ClusterA, ClusterB), - AValue = get_counter(hd(ClusterA)), - BValue = get_counter(hd(ClusterB)), - ExpectedValve = AExpected + BExpected, + ExpectedValue = AExpected + BExpected, - ?assertEqual(ExpectedValve, AValue), - ?assertEqual(ExpectedValve, BValue), + ?assertEqual(ok, rt:wait_until(fun() -> verify_counter(ExpectedValue, hd(ClusterA)) end)), + ?assertEqual(ok, rt:wait_until(fun() -> verify_counter(ExpectedValue, hd(ClusterB)) end)), pass. make_clusters() -> @@ -87,6 +85,9 @@ get_counter({Client, _Node}) -> {ok, Val} = rhc:counter_val(Client, ?BUCKET, ?KEY), Val. +verify_counter(ExpectedValue, Node) -> + ExpectedValue == get_counter(Node). + rand_amt() -> crypto:rand_uniform(-100, 100).