Skip to content

Commit 370643a

Browse files
MQTT auth_SUITE: synchronise concurrent setup with the test
(cherry picked from commit e8fccba)
1 parent edf9122 commit 370643a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

deps/rabbitmq_mqtt/test/auth_SUITE.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,17 @@ client_id_propagation(Config) ->
396396
rabbit_auth_backend_mqtt_mock),
397397
%% setup creates the ETS table required for the mqtt auth mock
398398
%% it blocks indefinitely so we need to spawn
399+
Self = self(),
399400
_ = spawn(fun () ->
400401
rabbit_ct_broker_helpers:rpc(Config, 0, rabbit_auth_backend_mqtt_mock,
401402
setup,
402-
[])
403+
[Self])
403404
end),
405+
%% the setup process will notify us
406+
receive
407+
ok -> ok
408+
after 3000 -> ok
409+
end,
404410
ClientId = <<"client-id-propagation">>,
405411
{ok, C} = connect_user(<<"client-id-propagation">>, <<"client-id-propagation">>,
406412
Config, ClientId),

deps/rabbitmq_mqtt/test/rabbit_auth_backend_mqtt_mock.erl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
-behaviour(rabbit_authn_backend).
1414
-behaviour(rabbit_authz_backend).
1515

16-
-export([setup/0,
16+
-export([setup/1,
1717
user_login_authentication/2, user_login_authorization/2,
1818
check_vhost_access/3, check_resource_access/4, check_topic_access/4,
1919
state_can_expire/0,
2020
get/1]).
2121

22-
setup() ->
22+
setup(CallerPid) ->
2323
ets:new(?MODULE, [set, public, named_table]),
24+
CallerPid ! ok,
2425
receive
2526
stop -> ok
2627
end.

0 commit comments

Comments
 (0)