@@ -143,11 +143,11 @@ cluster_size_3_tests() ->
143
143
flow_stream ,
144
144
rabbit_mqtt_qos0_queue ,
145
145
cli_list_queues ,
146
- maintenance ,
147
146
delete_create_queue ,
148
147
session_reconnect ,
149
148
session_takeover ,
150
- duplicate_client_id
149
+ duplicate_client_id ,
150
+ maintenance
151
151
].
152
152
153
153
mnesia_store_tests () ->
@@ -1276,38 +1276,34 @@ cli_list_queues(Config) ->
1276
1276
ok = emqtt :disconnect (C ).
1277
1277
1278
1278
maintenance (Config ) ->
1279
- case is_feature_flag_enabled (Config , delete_ra_cluster_mqtt_node ) of
1280
- false ->
1281
- % % When either file rabbit_mqtt_collector changes or different OTP versions
1282
- % % are used for compilation, the rabbit_mqtt_collector module version will
1283
- % % change and cause a bad fun error when executing ra:leader_query/2 remotely.
1284
- {skip , " Anonymous fun as used in ra:leader_query/2 errors when executing "
1285
- " remotely with a different module version" };
1286
- true ->
1287
- C0 = connect (<<" client-0" >>, Config , 0 , []),
1288
- C1a = connect (<<" client-1a" >>, Config , 1 , []),
1289
- C1b = connect (<<" client-1b" >>, Config , 1 , []),
1290
- ClientsNode1 = [C1a , C1b ],
1279
+ % % When either file rabbit_mqtt_collector changes or different OTP versions
1280
+ % % are used for compilation, the rabbit_mqtt_collector module version will
1281
+ % % change and cause a bad fun error when executing ra:leader_query/2 remotely.
1282
+ ok = rabbit_ct_broker_helpers :enable_feature_flag (Config , delete_ra_cluster_mqtt_node ),
1291
1283
1292
- timer :sleep (500 ),
1284
+ C0 = connect (<<" client-0" >>, Config , 0 , []),
1285
+ C1a = connect (<<" client-1a" >>, Config , 1 , []),
1286
+ C1b = connect (<<" client-1b" >>, Config , 1 , []),
1287
+ ClientsNode1 = [C1a , C1b ],
1293
1288
1294
- ok = drain_node (Config , 2 ),
1295
- ok = revive_node (Config , 2 ),
1296
- timer :sleep (500 ),
1297
- [? assert (erlang :is_process_alive (C )) || C <- [C0 , C1a , C1b ]],
1289
+ timer :sleep (500 ),
1298
1290
1299
- process_flag (trap_exit , true ),
1300
- ok = drain_node (Config , 1 ),
1301
- [await_exit (Pid ) || Pid <- ClientsNode1 ],
1302
- [assert_v5_disconnect_reason_code (Config , ? RC_SERVER_SHUTTING_DOWN ) || _ <- ClientsNode1 ],
1303
- ok = revive_node (Config , 1 ),
1304
- ? assert (erlang :is_process_alive (C0 )),
1305
-
1306
- ok = drain_node (Config , 0 ),
1307
- await_exit (C0 ),
1308
- assert_v5_disconnect_reason_code (Config , ? RC_SERVER_SHUTTING_DOWN ),
1309
- ok = revive_node (Config , 0 )
1310
- end .
1291
+ ok = drain_node (Config , 2 ),
1292
+ ok = revive_node (Config , 2 ),
1293
+ timer :sleep (500 ),
1294
+ [? assert (erlang :is_process_alive (C )) || C <- [C0 , C1a , C1b ]],
1295
+
1296
+ process_flag (trap_exit , true ),
1297
+ ok = drain_node (Config , 1 ),
1298
+ [await_exit (Pid ) || Pid <- ClientsNode1 ],
1299
+ [assert_v5_disconnect_reason_code (Config , ? RC_SERVER_SHUTTING_DOWN ) || _ <- ClientsNode1 ],
1300
+ ok = revive_node (Config , 1 ),
1301
+ ? assert (erlang :is_process_alive (C0 )),
1302
+
1303
+ ok = drain_node (Config , 0 ),
1304
+ await_exit (C0 ),
1305
+ assert_v5_disconnect_reason_code (Config , ? RC_SERVER_SHUTTING_DOWN ),
1306
+ ok = revive_node (Config , 0 ).
1311
1307
1312
1308
keepalive (Config ) ->
1313
1309
KeepaliveSecs = 1 ,
@@ -1374,21 +1370,18 @@ keepalive_turned_off(Config) ->
1374
1370
ok = emqtt :disconnect (C ).
1375
1371
1376
1372
duplicate_client_id (Config ) ->
1373
+ % % When either file rabbit_mqtt_collector changes or different OTP versions
1374
+ % % are used for compilation, the rabbit_mqtt_collector module version will
1375
+ % % change and cause a bad fun error when executing ra:leader_query/2 remotely.
1376
+ ok = rabbit_ct_broker_helpers :enable_feature_flag (Config , delete_ra_cluster_mqtt_node ),
1377
+
1377
1378
[Server1 , Server2 , _ ] = rabbit_ct_broker_helpers :get_node_configs (Config , nodename ),
1378
1379
% % Test session takeover by both new and old node in mixed version clusters.
1379
1380
ClientId1 = <<" c1" >>,
1380
1381
ClientId2 = <<" c2" >>,
1381
1382
C1a = connect (ClientId1 , Config , Server2 , []),
1382
1383
C2a = connect (ClientId2 , Config , Server1 , []),
1383
- case is_feature_flag_enabled (Config , delete_ra_cluster_mqtt_node ) of
1384
- true ->
1385
- eventually (? _assertEqual (2 , length (all_connection_pids (Config ))));
1386
- false ->
1387
- % % When different OTP versions are used for compilation, the
1388
- % % rabbit_mqtt_collector module version will change and cause
1389
- % % a bad fun error when executing ra:leader_query/2 remotely.
1390
- timer :sleep (200 )
1391
- end ,
1384
+ eventually (? _assertEqual (2 , length (all_connection_pids (Config )))),
1392
1385
process_flag (trap_exit , true ),
1393
1386
C1b = connect (ClientId1 , Config , Server1 , []),
1394
1387
C2b = connect (ClientId2 , Config , Server2 , []),
@@ -1397,12 +1390,7 @@ duplicate_client_id(Config) ->
1397
1390
await_exit (C1a ),
1398
1391
await_exit (C2a ),
1399
1392
timer :sleep (200 ),
1400
- case is_feature_flag_enabled (Config , delete_ra_cluster_mqtt_node ) of
1401
- true ->
1402
- ? assertEqual (2 , length (all_connection_pids (Config )));
1403
- false ->
1404
- ok
1405
- end ,
1393
+ ? assertEqual (2 , length (all_connection_pids (Config ))),
1406
1394
ok = emqtt :disconnect (C1b ),
1407
1395
ok = emqtt :disconnect (C2b ),
1408
1396
eventually (? _assertEqual (0 , length (all_connection_pids (Config )))).
0 commit comments