From 9ca8aeb15576866e09085e5586dbf1391999fc55 Mon Sep 17 00:00:00 2001 From: Ilya Averyanov Date: Fri, 12 Jul 2024 12:09:55 +0300 Subject: [PATCH] chore(mgmt): reduce test flakyness --- .../test/emqx_mgmt_api_clients_SUITE.erl | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/emqx_management/test/emqx_mgmt_api_clients_SUITE.erl b/apps/emqx_management/test/emqx_mgmt_api_clients_SUITE.erl index e565b13b2..398b48ab7 100644 --- a/apps/emqx_management/test/emqx_mgmt_api_clients_SUITE.erl +++ b/apps/emqx_management/test/emqx_mgmt_api_clients_SUITE.erl @@ -1562,17 +1562,25 @@ t_bulk_subscribe(Config) -> Topic = <<"testtopic">>, BulkSub = [#{topic => Topic, qos => 1, nl => 1, rh => 1}], ?assertMatch({200, [_]}, bulk_subscribe_request(ClientId1, Config, BulkSub)), - ?assertMatch( - {200, [_]}, - get_subscriptions_request(ClientId1, Config, #{simplify_result => true}) + ?retry( + 100, + 5, + ?assertMatch( + {200, [_]}, + get_subscriptions_request(ClientId1, Config, #{simplify_result => true}) + ) ), {ok, _} = emqtt:publish(C2, Topic, <<"hi1">>, [{qos, 1}]), ?assertReceive({publish, #{topic := Topic, payload := <<"hi1">>}}), BulkUnsub = [#{topic => Topic}], ?assertMatch({204, _}, bulk_unsubscribe_request(ClientId1, Config, BulkUnsub)), - ?assertMatch( - {200, []}, - get_subscriptions_request(ClientId1, Config, #{simplify_result => true}) + ?retry( + 100, + 5, + ?assertMatch( + {200, []}, + get_subscriptions_request(ClientId1, Config, #{simplify_result => true}) + ) ), {ok, _} = emqtt:publish(C2, Topic, <<"hi2">>, [{qos, 1}]), ?assertNotReceive({publish, _}),