From 85eaf86f818af3a032e7d04a2c7091c500ae2ce1 Mon Sep 17 00:00:00 2001 From: Nick Marino Date: Wed, 30 Mar 2016 14:35:46 -0400 Subject: [PATCH] Fix false positive test fails caused by AAE race It is occasionally possible to see a YZ AAE repair in normal operation if we happen to be running the exchange FSM while writes are occurring, and we compare the KV tree (which already has the new data inserted) with the YZ tree (which doesn't have the data inserted yet). This ends up triggering an extra call to get_map, which could cause some earlier parts of this test to fail when it expected 60 calls but saw 61. To fix this, we can simply disable AAE at the start of the test, and then enable it later when we get to the part of the test that requires AAE. --- tests/yz_extractors.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/yz_extractors.erl b/tests/yz_extractors.erl index 4dd14065..eb288796 100644 --- a/tests/yz_extractors.erl +++ b/tests/yz_extractors.erl @@ -145,7 +145,9 @@ %% allow AAE to build trees and exchange rapidly {anti_entropy_build_limit, {100, 1000}}, {anti_entropy_concurrency, 8}, - {anti_entropy_tick, 1000} + {anti_entropy_tick, 1000}, + %% but start with AAE turned off so as not to interfere with earlier parts of the test + {anti_entropy, {off, []}} ]}, {yokozuna, [ @@ -318,6 +320,8 @@ test_extractor_with_aae_expire(Cluster, Index, Bucket, Packet) -> yokozuna_rt:search_expect({Host, Port}, Index, <<"host">>, <<"www*">>, 1), + rpc:multicall(Cluster, riak_kv_entropy_manager, enable, []), + yokozuna_rt:expire_trees(Cluster), yokozuna_rt:wait_for_full_exchange_round(Cluster, erlang:now()),