test(sessmem): drop unnecessary nesting in testcase
Also get rid of sneaky binding assignment.
This commit is contained in:
parent
98706cd215
commit
9362ef6f73
|
|
@ -178,8 +178,8 @@ t_publish_qos2_with_error_return(_) ->
|
|||
ok
|
||||
end),
|
||||
|
||||
Session = session(#{max_awaiting_rel => 2, awaiting_rel => #{PacketId1 = 1 => ts(millisecond)}}),
|
||||
begin
|
||||
PacketId1 = 1,
|
||||
Session = session(#{max_awaiting_rel => 2, awaiting_rel => #{PacketId1 => ts(millisecond)}}),
|
||||
Msg1 = emqx_message:make(clientid, ?QOS_2, <<"t">>, <<"payload1">>),
|
||||
{error, RC1 = ?RC_PACKET_IDENTIFIER_IN_USE} = emqx_session:publish(
|
||||
clientinfo(), PacketId1, Msg1, Session
|
||||
|
|
@ -190,10 +190,8 @@ t_publish_qos2_with_error_return(_) ->
|
|||
?assertEqual(RecMsg1, Msg1)
|
||||
after 1000 ->
|
||||
ct:fail(?FUNCTION_NAME)
|
||||
end
|
||||
end,
|
||||
|
||||
begin
|
||||
Msg2 = emqx_message:make(clientid, ?QOS_2, <<"t">>, <<"payload2">>),
|
||||
{ok, [], Session1} = emqx_session:publish(
|
||||
clientinfo(), _PacketId2 = 2, Msg2, Session
|
||||
|
|
@ -208,8 +206,8 @@ t_publish_qos2_with_error_return(_) ->
|
|||
?assertEqual(RecMsg2, Msg2)
|
||||
after 1000 ->
|
||||
ct:fail(?FUNCTION_NAME)
|
||||
end
|
||||
end,
|
||||
|
||||
ok = meck:expect(emqx_hooks, run, fun(_Hook, _Args) -> ok end).
|
||||
|
||||
t_is_awaiting_full_false(_) ->
|
||||
|
|
|
|||
Loading…
Reference in New Issue