From d639042e0dba20c3eed093a08b0fb0cfa18f1e6c Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Tue, 6 Oct 2020 20:23:58 +0300 Subject: Switch to new CT helpers --- test/quorum_queue_SUITE.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/quorum_queue_SUITE.erl b/test/quorum_queue_SUITE.erl index 16042b71e8..d428cb0701 100644 --- a/test/quorum_queue_SUITE.erl +++ b/test/quorum_queue_SUITE.erl @@ -2105,15 +2105,19 @@ memory_alarm_rolls_wal(Config) -> [Server | _] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename), WalDataDir = rpc:call(Server, ra_env, wal_data_dir, []), [Wal0] = filelib:wildcard(WalDataDir ++ "/*.wal"), - ok = rpc:call(Server, rabbit_alarm, set_alarm, - [{{resource_limit, memory, Server}, []}]), + rabbit_ct_broker_helpers:set_alarm(Config, Server, memory), + rabbit_ct_helpers:await_condition( + fun() -> rabbit_ct_broker_helpers:get_alarms(Config, Server) =/= [] end + ), timer:sleep(1000), [Wal1] = filelib:wildcard(WalDataDir ++ "/*.wal"), ?assert(Wal0 =/= Wal1), %% roll over shouldn't happen if we trigger a new alarm in less than %% min_wal_roll_over_interval - ok = rpc:call(Server, rabbit_alarm, set_alarm, - [{{resource_limit, memory, Server}, []}]), + rabbit_ct_broker_helpers:set_alarm(Config, Server, memory), + rabbit_ct_helpers:await_condition( + fun() -> rabbit_ct_broker_helpers:get_alarms(Config, Server) =/= [] end + ), timer:sleep(1000), [Wal2] = filelib:wildcard(WalDataDir ++ "/*.wal"), ?assert(Wal1 == Wal2), -- cgit v1.2.1