summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniil Fedotov <dfedotov@pivotal.io>2016-12-20 18:38:40 +0000
committerDaniil Fedotov <dfedotov@pivotal.io>2016-12-20 18:38:40 +0000
commit308a2b5f5603b20906de2bec0d7d80ff99073e86 (patch)
tree83510fb6ce02038617df748e16527e89de782d9f /test
parent5f7553c0bd2eac3fc311761bc2b81763f537c1e5 (diff)
downloadrabbitmq-server-git-308a2b5f5603b20906de2bec0d7d80ff99073e86.tar.gz
Group recovery client refs by vhost
Diffstat (limited to 'test')
-rw-r--r--test/channel_operation_timeout_test_queue.erl27
1 files changed, 19 insertions, 8 deletions
diff --git a/test/channel_operation_timeout_test_queue.erl b/test/channel_operation_timeout_test_queue.erl
index 5e256b1381..5a41eb86bf 100644
--- a/test/channel_operation_timeout_test_queue.erl
+++ b/test/channel_operation_timeout_test_queue.erl
@@ -215,14 +215,25 @@
start(DurableQueues) ->
{AllTerms, StartFunState} = rabbit_queue_index:start(DurableQueues),
- start_msg_store(
- [Ref || Terms <- AllTerms,
- Terms /= non_clean_shutdown,
- begin
- Ref = proplists:get_value(persistent_ref, Terms),
- Ref =/= undefined
- end],
- StartFunState),
+ %% Group recovery terms by vhost.
+ {[], VhostRefs} = lists:foldl(
+ fun
+ %% We need to skip a queue name
+ (non_clean_shutdown, {[_|QNames], VhostRefs}) ->
+ {QNames, VhostRefs};
+ (Terms, {[QueueName | QNames], VhostRefs}) ->
+ case proplists:get_value(persistent_ref, Terms) of
+ undefined -> {QNames, VhostRefs};
+ Ref ->
+ #resource{virtual_host = VHost} = QueueName,
+ Refs = case maps:find(VHost, VhostRefs) of
+ {ok, Val} -> Val;
+ error -> []
+ end,
+ {QNames, maps:put(VHost, [Ref|Refs], VhostRefs)}
+ end
+ end),
+ start_msg_store(VhostRefs, StartFunState),
{ok, AllTerms}.
stop() ->