test: stabilize flaky test
This commit is contained in:
parent
b0aa7f25aa
commit
f062517ccb
|
@ -884,26 +884,23 @@ t_kick_session(Config) ->
|
||||||
{will_qos, 1}
|
{will_qos, 1}
|
||||||
],
|
],
|
||||||
Commands =
|
Commands =
|
||||||
%% GIVEN: client connect with willmsg payload <<"willpayload_kick">>
|
lists:flatten([
|
||||||
[{fun start_client/5, [ClientId, ClientId, ?QOS_1, WillOpts]}] ++
|
%% GIVEN: client connect with willmsg payload <<"willpayload_kick">>
|
||||||
[
|
{fun start_client/5, [ClientId, ClientId, ?QOS_1, WillOpts]},
|
||||||
{fun start_client/5, [
|
{fun start_client/5, [
|
||||||
<<ClientId/binary, <<"_willsub">>/binary>>, WillTopic, ?QOS_1, []
|
<<ClientId/binary, <<"_willsub">>/binary>>, WillTopic, ?QOS_1, []
|
||||||
]}
|
]},
|
||||||
] ++
|
%% kick may fail (not found) without this delay
|
||||||
[
|
{
|
||||||
%% kick may fail (not found) without this delay
|
fun(CTX) ->
|
||||||
{
|
timer:sleep(300),
|
||||||
fun(CTX) ->
|
CTX
|
||||||
timer:sleep(100),
|
end,
|
||||||
CTX
|
[]
|
||||||
end,
|
},
|
||||||
[]
|
|
||||||
}
|
|
||||||
] ++
|
|
||||||
%% WHEN: client is kicked with kick_session
|
%% WHEN: client is kicked with kick_session
|
||||||
[{fun kick_client/2, [ClientId]}],
|
{fun kick_client/2, [ClientId]}
|
||||||
|
]),
|
||||||
FCtx = lists:foldl(
|
FCtx = lists:foldl(
|
||||||
fun({Fun, Args}, Ctx) ->
|
fun({Fun, Args}, Ctx) ->
|
||||||
ct:pal("COMMAND: ~p ~p", [element(2, erlang:fun_info(Fun, name)), Args]),
|
ct:pal("COMMAND: ~p ~p", [element(2, erlang:fun_info(Fun, name)), Args]),
|
||||||
|
|
Loading…
Reference in New Issue