Procházet zdrojové kódy

Fix the test case 't_handle_disconnect'

Feng Lee před 6 roky
rodič
revize
6aac73f51f
2 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 2 0
      src/emqx_channel.erl
  2. 1 1
      test/emqx_channel_SUITE.erl

+ 2 - 0
src/emqx_channel.erl

@@ -129,6 +129,8 @@ info(topic_aliases, #channel{topic_aliases = Aliases}) ->
     Aliases;
 info(alias_maximum, #channel{alias_maximum = Limits}) ->
     Limits;
+info(will_msg, #channel{will_msg = WillMsg}) ->
+    WillMsg;
 info(gc_state, #channel{gc_state = GcState}) ->
     maybe_apply(fun emqx_gc:info/1, GcState);
 info(oom_policy, #channel{oom_policy = OomPolicy}) ->

+ 1 - 1
test/emqx_channel_SUITE.erl

@@ -145,7 +145,7 @@ t_handle_disconnect(_) ->
     with_channel(
       fun(Channel) ->
               {wait_session_expire, {shutdown, normal}, Channel1} = handle_in(?DISCONNECT_PACKET(?RC_SUCCESS), Channel),
-              ?assertMatch(#{will_msg := undefined}, emqx_channel:info(protocol, Channel1))
+              ?assertEqual(undefined, emqx_channel:info(will_msg, Channel1))
       end).
 
 t_handle_auth(_) ->