MQTT auth_SUITE: terminate setup process
Configuring the mock authentication backend blocks and generates an error in the test process when the broker goes down. The error report makes the test fail in some environments. The process where the setup takes place must stay up otherwise the ETS table used will go away. This commit makes sure the broker-side authentication backend setup returns at the end of the test. This way the calling process terminates in a normal way.
This commit is contained in:
parent
2c96bccc08
commit
58d835ba5d
|
@ -526,8 +526,8 @@ client_id_propagation(Config) ->
|
|||
rpc(Config, 0, rabbit_auth_backend_mqtt_mock, setup, [Self])
|
||||
end),
|
||||
%% the setup process will notify us
|
||||
receive
|
||||
ok -> ok
|
||||
SetupProcess = receive
|
||||
{ok, SP} -> SP
|
||||
after
|
||||
3000 -> ct:fail("timeout waiting for rabbit_auth_backend_mqtt_mock:setup/1")
|
||||
end,
|
||||
|
@ -561,7 +561,11 @@ client_id_propagation(Config) ->
|
|||
VariableMap = maps:get(variable_map, TopicContext),
|
||||
?assertEqual(ClientId, maps:get(<<"client_id">>, VariableMap)),
|
||||
|
||||
ok = emqtt:disconnect(C).
|
||||
ok = emqtt:disconnect(C),
|
||||
|
||||
SetupProcess ! stop,
|
||||
|
||||
ok.
|
||||
|
||||
%% These tests try to cover all operations that are listed in the
|
||||
%% table in https://www.rabbitmq.com/access-control.html#authorisation
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
setup(CallerPid) ->
|
||||
ets:new(?MODULE, [set, public, named_table]),
|
||||
CallerPid ! ok,
|
||||
CallerPid ! {ok, self()},
|
||||
receive
|
||||
stop -> ok
|
||||
end.
|
||||
|
|
Loading…
Reference in New Issue