fix(test): update testcases for retry_interval

This commit is contained in:
Shawn 2021-07-23 11:32:22 +08:00
parent 93e1257045
commit c5bc7e7e57
1 changed files with 4 additions and 2 deletions

View File

@ -309,9 +309,11 @@ t_enqueue(_) ->
t_retry(_) -> t_retry(_) ->
Delivers = [delivery(?QOS_1, <<"t1">>), delivery(?QOS_2, <<"t2">>)], Delivers = [delivery(?QOS_1, <<"t1">>), delivery(?QOS_2, <<"t2">>)],
Session = session(#{retry_interval => 100000}), RetryIntervalMs = 100, %% 0.1s
Session = session(#{retry_interval => RetryIntervalMs}),
{ok, Pubs, Session1} = emqx_session:deliver(Delivers, Session), {ok, Pubs, Session1} = emqx_session:deliver(Delivers, Session),
ok = timer:sleep(200), ElapseMs = 200, %% 0.2s
ok = timer:sleep(ElapseMs),
Msgs1 = [{I, emqx_message:set_flag(dup, Msg)} || {I, Msg} <- Pubs], Msgs1 = [{I, emqx_message:set_flag(dup, Msg)} || {I, Msg} <- Pubs],
{ok, Msgs1, 100, Session2} = emqx_session:retry(Session1), {ok, Msgs1, 100, Session2} = emqx_session:retry(Session1),
?assertEqual(2, emqx_session:info(inflight_cnt, Session2)). ?assertEqual(2, emqx_session:info(inflight_cnt, Session2)).