Skip to content

Commit c5120b1

Browse files
author
Daniil Fedotov
committed
WIP. fixing tests
1 parent 7f90953 commit c5120b1

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/rabbit_variable_queue.erl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,27 +1291,27 @@ msg_store_write(MSCState, IsPersistent, MsgId, Msg) ->
12911291
with_immutable_msg_store_state(
12921292
MSCState, IsPersistent,
12931293
fun ({Mod, MSCState1}) ->
1294-
Mod:write_flow(MsgId, Msg, MSCState1)
1294+
{Mod, Mod:write_flow(MsgId, Msg, MSCState1)}
12951295
end).
12961296

12971297
msg_store_read(MSCState, IsPersistent, MsgId) ->
12981298
with_msg_store_state(
12991299
MSCState, IsPersistent,
13001300
fun ({Mod, MSCState1}) ->
1301-
Mod:read(MsgId, MSCState1)
1301+
{Mod, Mod:read(MsgId, MSCState1)}
13021302
end).
13031303

13041304
msg_store_remove(MSCState, IsPersistent, MsgIds) ->
13051305
with_immutable_msg_store_state(
13061306
MSCState, IsPersistent,
13071307
fun ({Mod, MSCState1}) ->
1308-
Mod:remove(MsgIds, MSCState1)
1308+
{Mod, Mod:remove(MsgIds, MSCState1)}
13091309
end).
13101310

13111311
msg_store_close_fds(MSCState, IsPersistent) ->
13121312
with_msg_store_state(
13131313
MSCState, IsPersistent,
1314-
fun ({Mod, MSCState1}) -> Mod:close_all_indicated(MSCState1) end).
1314+
fun ({Mod, MSCState1}) -> {Mod, Mod:close_all_indicated(MSCState1)} end).
13151315

13161316
msg_store_close_fds_fun(IsPersistent) ->
13171317
fun (?MODULE, State = #vqstate { msg_store_clients = MSCState }) ->
@@ -2938,6 +2938,7 @@ start_new_store_sup() ->
29382938
ok = rabbit_sup:start_child(?PERSISTENT_MSG_STORE_SUP,
29392939
rabbit_msg_store_vhost_sup,
29402940
[?PERSISTENT_MSG_STORE_SUP,
2941+
rabbit_msg_store,
29412942
undefined, {fun (ok) -> finished end, ok}]),
29422943
?PERSISTENT_MSG_STORE_SUP.
29432944

test/backing_queue_SUITE.erl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,11 @@ on_disk_stop(Pid) ->
376376

377377
msg_store_client_init_capture(MsgStore, Ref) ->
378378
Pid = spawn(fun on_disk_capture/0),
379-
{Pid, rabbit_msg_store_vhost_sup:client_init(
379+
{rabbit_msg_store, MSCState} = rabbit_msg_store_vhost_sup:client_init(
380380
MsgStore, Ref, fun (MsgIds, _ActionTaken) ->
381381
Pid ! {on_disk, MsgIds}
382-
end, undefined, <<"/">>)}.
382+
end, undefined, <<"/">>),
383+
{Pid, MSCState}.
383384

384385
msg_store_contains(Atom, MsgIds, MSCState) ->
385386
Atom = lists:foldl(
@@ -456,7 +457,7 @@ test_msg_store_confirm_timer() ->
456457
Ref = rabbit_guid:gen(),
457458
MsgId = msg_id_bin(1),
458459
Self = self(),
459-
MSCState = rabbit_msg_store_vhost_sup:client_init(
460+
{rabbit_msg_store, MSCState} = rabbit_msg_store_vhost_sup:client_init(
460461
?PERSISTENT_MSG_STORE, Ref,
461462
fun (MsgIds, _ActionTaken) ->
462463
case gb_sets:is_member(MsgId, MsgIds) of
@@ -1337,7 +1338,8 @@ nop(_) -> ok.
13371338
nop(_, _) -> ok.
13381339

13391340
msg_store_client_init(MsgStore, Ref) ->
1340-
rabbit_msg_store_vhost_sup:client_init(MsgStore, Ref, undefined, undefined, <<"/">>).
1341+
{rabbit_msg_store, MSCState} = rabbit_msg_store_vhost_sup:client_init(MsgStore, Ref, undefined, undefined, <<"/">>),
1342+
MSCState.
13411343

13421344
variable_queue_init(Q, Recover) ->
13431345
rabbit_variable_queue:init(

0 commit comments

Comments
 (0)