test(quic): fix flaky test

This commit is contained in:
William Yang 2023-01-18 19:57:15 +01:00
parent db544cf9ad
commit f4f346e387
1 changed files with 9 additions and 10 deletions

View File

@ -527,7 +527,7 @@ t_multi_streams_packet_boundary(Config) ->
[{qos, PubQos}],
undefined
),
LargePart3 = binary:copy(<<"stream data3">>, 2000),
LargePart3 = binary:copy(atom_to_binary(?FUNCTION_NAME), 20000),
ok = emqtt:publish_async(
C,
PubVia,
@ -603,7 +603,7 @@ t_multi_streams_packet_malform(Config) ->
[{qos, PubQos}],
undefined
),
LargePart3 = binary:copy(<<"stream data3">>, 2000),
LargePart3 = binary:copy(atom_to_binary(?FUNCTION_NAME), 2000),
ok = emqtt:publish_async(
C,
PubVia,
@ -1221,6 +1221,12 @@ t_multi_streams_shutdown_pub_data_stream(Config) ->
end,
PubRecvs = recv_pub(1),
#{data_stream_socks := [PubVia | _]} = proplists:get_value(extra, emqtt:info(C)),
{quic, _Conn, DataStream} = PubVia,
quicer:shutdown_stream(DataStream, ?config(stream_shutdown_flag, Config), 500, 100),
timer:sleep(500),
%% Still alive
?assert(is_list(emqtt:info(C))),
?assertMatch(
[
{publish, #{
@ -1231,14 +1237,7 @@ t_multi_streams_shutdown_pub_data_stream(Config) ->
}}
],
PubRecvs
),
#{data_stream_socks := [PubVia | _]} = proplists:get_value(extra, emqtt:info(C)),
{quic, _Conn, DataStream} = PubVia,
quicer:shutdown_stream(DataStream, ?config(stream_shutdown_flag, Config), 500, 100),
timer:sleep(500),
%% Still alive
?assert(is_list(emqtt:info(C))).
).
t_multi_streams_shutdown_sub_data_stream(Config) ->
PubQos = ?config(pub_qos, Config),