Просмотр исходного кода

ci: update testcases that use emqtt

Shawn 1 год назад
Родитель
Сommit
fb0204bef6

+ 2 - 3
apps/emqx/test/emqx_listeners_SUITE.erl

@@ -379,9 +379,8 @@ t_wss_update_opts(Config) ->
         ),
 
         %% Unable to connect with old SSL options, server's cert is signed by another CA.
-        %% Due to a bug `emqtt` exits with `badmatch` in this case.
-        ?assertExit(
-            _Badmatch,
+        ?assertError(
+            timeout,
             emqtt_connect_wss(Host, Port, ClientSSLOpts)
         ),
 

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

@@ -1021,7 +1021,7 @@ t_share_subscribe_no_local(Config) ->
     %% MQTT-5.0 [MQTT-3.8.3-4] and [MQTT-4.13.1-1] (Disconnect)
     case catch emqtt:subscribe(Client, #{}, [{ShareTopic, [{nl, true}, {qos, 1}]}]) of
         {'EXIT', {Reason, _Stk}} ->
-            ?assertEqual({disconnected, ?RC_PROTOCOL_ERROR, #{}}, Reason)
+            ?assertEqual({shutdown, {disconnected, ?RC_PROTOCOL_ERROR, #{}}}, Reason)
     end,
 
     process_flag(trap_exit, false).

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

@@ -368,7 +368,7 @@ t_connect_discards_existing_client(Config) ->
 
     receive
         {'DOWN', MRef, process, Client1, Reason} ->
-            ok = ?assertMatch({disconnected, ?RC_SESSION_TAKEN_OVER, _}, Reason),
+            ok = ?assertMatch({shutdown, {disconnected, ?RC_SESSION_TAKEN_OVER, _}}, Reason),
             ok = emqtt:stop(Client2),
             ok
     after 1000 ->

+ 2 - 2
apps/emqx/test/emqx_takeover_SUITE.erl

@@ -1072,7 +1072,7 @@ filter_payload(List, Payload) when is_binary(Payload) ->
 %% @doc assert emqtt *client* process exits as expected.
 assert_client_exit(Pid, v5, takenover) ->
     %% @ref: MQTT 5.0 spec [MQTT-3.1.4-3]
-    ?assertReceive({'EXIT', Pid, {disconnected, ?RC_SESSION_TAKEN_OVER, _}});
+    ?assertReceive({'EXIT', Pid, {shutdown, {disconnected, ?RC_SESSION_TAKEN_OVER, _}}});
 assert_client_exit(Pid, v3, takenover) ->
     ?assertReceive(
         {'EXIT', Pid, {shutdown, Reason}} when
@@ -1084,7 +1084,7 @@ assert_client_exit(Pid, v3, takenover) ->
 assert_client_exit(Pid, v3, kicked) ->
     ?assertReceive({'EXIT', Pid, _}, 1_000, #{pid => Pid});
 assert_client_exit(Pid, v5, kicked) ->
-    ?assertReceive({'EXIT', Pid, {disconnected, ?RC_ADMINISTRATIVE_ACTION, _}});
+    ?assertReceive({'EXIT', Pid, {shutdown, {disconnected, ?RC_ADMINISTRATIVE_ACTION, _}}});
 assert_client_exit(Pid, _, killed) ->
     ?assertReceive({'EXIT', Pid, killed}).
 

+ 1 - 1
apps/emqx_auth_http/test/emqx_authn_http_SUITE.erl

@@ -584,7 +584,7 @@ t_auth_expire(_Config) ->
             {ok, _} = emqtt:connect(C),
             receive
                 {'DOWN', _Ref, process, C, Reason} ->
-                    ?assertMatch({disconnected, ?RC_NOT_AUTHORIZED, _}, Reason)
+                    ?assertMatch({shutdown, {disconnected, ?RC_NOT_AUTHORIZED, _}}, Reason)
             after WaitTime ->
                 error(timeout)
             end

+ 1 - 1
apps/emqx_eviction_agent/test/emqx_eviction_agent_SUITE.erl

@@ -227,7 +227,7 @@ t_explicit_session_takeover(Config) ->
         begin
             ok = rpc:call(Node1, emqx_eviction_agent, evict_connections, [1]),
             receive
-                {'EXIT', C0, {disconnected, ?RC_USE_ANOTHER_SERVER, _}} -> ok
+                {'EXIT', C0, {shutdown, {disconnected, ?RC_USE_ANOTHER_SERVER, _}}} -> ok
             after 1000 ->
                 ?assert(false, "Connection not evicted")
             end

+ 2 - 2
apps/emqx_node_rebalance/test/emqx_node_rebalance_evacuation_SUITE.erl

@@ -204,7 +204,7 @@ t_conn_evicted(Config) ->
     ),
 
     receive
-        {'EXIT', C, {disconnected, 156, _}} -> ok
+        {'EXIT', C, {shutdown, {disconnected, 156, _}}} -> ok
     after 1000 ->
         ct:fail("Connection not evicted")
     end.
@@ -245,7 +245,7 @@ t_session_evicted(Config) ->
     ),
 
     receive
-        {'EXIT', C, {disconnected, ?RC_USE_ANOTHER_SERVER, _}} -> ok
+        {'EXIT', C, {shutdown, {disconnected, ?RC_USE_ANOTHER_SERVER, _}}} -> ok
     after 1000 ->
         ct:fail("Connection not evicted")
     end,