summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kuryloski <kuryloskip@vmware.com>2020-06-10 10:00:48 +0200
committerGitHub <noreply@github.com>2020-06-10 10:00:48 +0200
commit4aafa785086357a32c6f7953a93956630a94bbc2 (patch)
tree7b89c5ce63e8a71989b0b5cc96618ffa689d66f0
parent92cd21902560d84eeaa33d4f104214823985e477 (diff)
parente2c324b79c112b8f99916eaada985367fa35858f (diff)
downloadrabbitmq-server-git-4aafa785086357a32c6f7953a93956630a94bbc2.tar.gz
Merge pull request #2375 from rabbitmq/rabbit-fifo-int-test-stability
Attempt to increase rabbit_fifo_int_SUITE stability
-rw-r--r--test/rabbit_fifo_int_SUITE.erl24
1 files changed, 14 insertions, 10 deletions
diff --git a/test/rabbit_fifo_int_SUITE.erl b/test/rabbit_fifo_int_SUITE.erl
index 5790964c91..b51975b062 100644
--- a/test/rabbit_fifo_int_SUITE.erl
+++ b/test/rabbit_fifo_int_SUITE.erl
@@ -475,24 +475,28 @@ test_queries(Config) ->
ClusterName = ?config(cluster_name, Config),
ServerId = ?config(node_id, Config),
ok = start_cluster(ClusterName, [ServerId]),
+ Self = self(),
P = spawn(fun () ->
F0 = rabbit_fifo_client:init(ClusterName, [ServerId], 4),
{ok, F1} = rabbit_fifo_client:enqueue(m1, F0),
{ok, F2} = rabbit_fifo_client:enqueue(m2, F1),
process_ra_events(receive_ra_events(2, 0), F2),
- receive stop -> ok end
+ Self ! ready,
+ receive stop -> ok end
end),
F0 = rabbit_fifo_client:init(ClusterName, [ServerId], 4),
+ ok = receive ready -> ok after 5000 -> timeout end,
{ok, _} = rabbit_fifo_client:checkout(<<"tag">>, 1, undefined, F0),
- {ok, {_, Ready}, _} = ra:local_query(ServerId,
- fun rabbit_fifo:query_messages_ready/1),
- ?assertEqual(1, Ready),
- {ok, {_, Checked}, _} = ra:local_query(ServerId,
- fun rabbit_fifo:query_messages_checked_out/1),
- ?assertEqual(1, Checked),
- {ok, {_, Processes}, _} = ra:local_query(ServerId,
- fun rabbit_fifo:query_processes/1),
- ?assertEqual(2, length(Processes)),
+ ?assertMatch({ok, {_RaIdxTerm, 1}, _Leader},
+ ra:local_query(ServerId,
+ fun rabbit_fifo:query_messages_ready/1)),
+ ?assertMatch({ok, {_RaIdxTerm, 1}, _Leader},
+ ra:local_query(ServerId,
+ fun rabbit_fifo:query_messages_checked_out/1)),
+ ?assertMatch({ok, {_RaIdxTerm, Processes}, _Leader}
+ when length(Processes) == 2,
+ ra:local_query(ServerId,
+ fun rabbit_fifo:query_processes/1)),
P ! stop,
ra:stop_server(ServerId),
ok.