From 3cd7d80d0475ab5fca1b5394d41cbaa6eb648aa1 Mon Sep 17 00:00:00 2001 From: David Ansari Date: Thu, 9 Feb 2023 11:17:52 +0000 Subject: [PATCH] Enable feature flag in test case Always enable feature flag rabbit_mqtt_qos0_queue in test case rabbit_mqtt_qos0_queue_overflow because this test case does not make sense without the mqtt_qos0 queue type. Note that enabling the feature flag should always succeed because this test case runs on a single node, and therefore on a new version in mixed version tests. --- deps/rabbitmq_mqtt/test/reader_SUITE.erl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/deps/rabbitmq_mqtt/test/reader_SUITE.erl b/deps/rabbitmq_mqtt/test/reader_SUITE.erl index 5eb3c86207..c4ac01b8f7 100644 --- a/deps/rabbitmq_mqtt/test/reader_SUITE.erl +++ b/deps/rabbitmq_mqtt/test/reader_SUITE.erl @@ -261,6 +261,8 @@ event_authentication_failure(Config) -> %% Test that queue type rabbit_mqtt_qos0_queue drops QoS 0 messages when its %% max length is reached. rabbit_mqtt_qos0_queue_overflow(Config) -> + ok = rabbit_ct_broker_helpers:enable_feature_flag(Config, rabbit_mqtt_qos0_queue), + Topic = atom_to_binary(?FUNCTION_NAME), Msg = binary:copy(<<"x">>, 1000), NumMsgs = 10_000, @@ -299,15 +301,10 @@ rabbit_mqtt_qos0_queue_overflow(Config) -> %% We expect that %% 1. all sent messages were either received or dropped ?assertEqual(NumMsgs, NumReceived + NumDropped), - case rabbit_ct_broker_helpers:is_feature_flag_enabled(Config, rabbit_mqtt_qos0_queue) of - true -> - %% 2. at least one message was dropped (otherwise our whole test case did not - %% test what it was supposed to test: that messages are dropped due to the - %% server being overflowed with messages while the client receives too slowly) - ?assert(NumDropped >= 1); - false -> - ?assertEqual(0, NumDropped) - end, + %% 2. at least one message was dropped (otherwise our whole test case did not + %% test what it was supposed to test: that messages are dropped due to the + %% server being overflowed with messages while the client receives too slowly) + ?assert(NumDropped >= 1), %% 3. we received at least 1000 messages because everything below the default %% of mailbox_soft_limit=1000 should not be dropped ?assert(NumReceived >= 1000),