Sfoglia il codice sorgente

Merge pull request #10886 from thalesmg/test-flakiness-20230530-d

test(quic_multistreams): attempt to fix flaky tests
Thales Macedo Garitezi 2 anni fa
parent
commit
299a67656e

+ 1 - 1
apps/emqx/test/emqx_channel_SUITE.erl

@@ -892,7 +892,7 @@ t_handle_kicked_publish_will_msg(_) ->
     ),
     receive
         {pub, Msg} -> ok
-    after 1_000 -> exit(will_message_not_published)
+    after 10_000 -> exit(will_message_not_published)
     end.
 
 t_handle_call_discard(_) ->

+ 7 - 1
apps/emqx/test/emqx_quic_multistreams_SUITE.erl

@@ -24,6 +24,7 @@
 -include_lib("common_test/include/ct.hrl").
 -include_lib("quicer/include/quicer.hrl").
 -include_lib("emqx/include/emqx_mqtt.hrl").
+-include_lib("snabbkaffe/include/snabbkaffe.hrl").
 
 suite() ->
     [{timetrap, {seconds, 30}}].
@@ -1089,6 +1090,11 @@ t_multi_streams_unsub(Config) ->
     ),
 
     emqtt:unsubscribe_via(C, SubVia, Topic),
+    ?retry(
+        _Sleep2 = 100,
+        _Attempts2 = 50,
+        false = emqx_router:has_routes(Topic)
+    ),
 
     case emqtt:publish_via(C, PubVia, Topic, #{}, <<6, 7, 8, 9>>, [{qos, PubQos}]) of
         ok when PubQos == 0 ->
@@ -1569,7 +1575,7 @@ t_multi_streams_remote_shutdown(Config) ->
 
     ok = stop_emqx(),
     %% Client should be closed
-    assert_client_die(C, 100, 50).
+    assert_client_die(C, 100, 200).
 
 t_multi_streams_remote_shutdown_with_reconnect(Config) ->
     erlang:process_flag(trap_exit, true),

+ 1 - 1
apps/emqx/test/emqx_shared_sub_SUITE.erl

@@ -666,7 +666,7 @@ t_local_fallback(Config) when is_list(Config) ->
     {true, UsedSubPid1} = last_message(<<"hello1">>, [ConnPid1]),
 
     rpc:call(Node, emqx, publish, [Message2]),
-    {true, UsedSubPid2} = last_message(<<"hello2">>, [ConnPid1]),
+    {true, UsedSubPid2} = last_message(<<"hello2">>, [ConnPid1], 2_000),
 
     emqtt:stop(ConnPid1),
     stop_slave(Node),