@@ -113,6 +113,7 @@ cluster_size_1_tests() ->
113113 ,block
114114 ,amqp_to_mqtt_qos0
115115 ,clean_session_disconnect_client
116+ ,zero_session_expiry_interval_disconnect_client
116117 ,clean_session_node_restart
117118 ,clean_session_node_kill
118119 ,rabbit_status_connection_count
@@ -211,6 +212,7 @@ init_per_testcase(T, Config)
211212 init_per_testcase0 (T , Config );
212213init_per_testcase (T , Config )
213214 when T =:= clean_session_disconnect_client ;
215+ T =:= zero_session_expiry_interval_disconnect_client ;
214216 T =:= clean_session_node_restart ;
215217 T =:= clean_session_node_kill ;
216218 T =:= notify_consumer_qos0_queue_deleted ->
@@ -229,6 +231,7 @@ end_per_testcase(T, Config)
229231 end_per_testcase0 (T , Config );
230232end_per_testcase (T , Config )
231233 when T =:= clean_session_disconnect_client ;
234+ T =:= zero_session_expiry_interval_disconnect_client ;
232235 T =:= clean_session_node_restart ;
233236 T =:= clean_session_node_kill ;
234237 T =:= notify_consumer_qos0_queue_deleted ->
@@ -1583,6 +1586,18 @@ clean_session_disconnect_client(Config) ->
15831586 L = rpc (Config , rabbit_amqqueue , list , []),
15841587 ? assertEqual (0 , length (L )).
15851588
1589+ zero_session_expiry_interval_disconnect_client (Config ) ->
1590+ C = connect (? FUNCTION_NAME , Config , [{properties , #{'Session-Expiry-Interval' => 0 }}]),
1591+ {ok , _ , _ } = emqtt :subscribe (C , <<" topic0" >>, qos0 ),
1592+ QsQos0 = rpc (Config , rabbit_amqqueue , list_by_type , [rabbit_mqtt_qos0_queue ]),
1593+ ? assertEqual (1 , length (QsQos0 )),
1594+
1595+ ok = emqtt :disconnect (C ),
1596+ % % After terminating a clean session, we expect any session state to be cleaned up on the server.
1597+ timer :sleep (200 ), % % Give some time to clean up exclusive classic queue.
1598+ L = rpc (Config , rabbit_amqqueue , list , []),
1599+ ? assertEqual (0 , length (L )).
1600+
15861601clean_session_node_restart (Config ) ->
15871602 clean_session_node_down (stop_node , Config ).
15881603
0 commit comments