From 8fe29170658b212a42fcda5983505d69c7e97b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Mon, 20 Jan 2025 15:12:32 +0100 Subject: [PATCH] rabbitmq_ct_helpers: Always give `$RABBITMQ_FEATURE_FLAGS` a value ... even if `skip_metadata_store_configuration` is given. [Why] If `skip_metadata_store_configuration` is set to true, we let the node boot with the stable feature flags all enabled. This may prevent clustering in mixed-version testing if the secondary umbrella misses a stable feature flag. [How] If `skip_metadata_store_configuration` is set, we restore the previous behavior of starting the node with the required feature flags only. I.e. all stable ones are disabled at first. --- .../src/rabbit_ct_broker_helpers.erl | 57 +++++++++++-------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl b/deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl index f686db6bc4d1..3f75cba624bc 100644 --- a/deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl +++ b/deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl @@ -1051,31 +1051,38 @@ configured_metadata_store(Config) -> end. configure_metadata_store(Config) -> - case skip_metadata_store_configuration(Config) of - true -> - ct:log("Skipping metadata store configuration as requested"), - Config; - false -> - ct:log("Configuring metadata store..."), - MetadataStore = configured_metadata_store(Config), - Config1 = rabbit_ct_helpers:set_config( - Config, {metadata_store, MetadataStore}), - FeatureNames0 = case MetadataStore of - mnesia -> - ct:log("Enabling Mnesia metadata store"), - ?REQUIRED_FEATURE_FLAGS; - khepri -> - ct:log("Enabling Khepri metadata store"), - [khepri_db | ?REQUIRED_FEATURE_FLAGS] - end, - OtherFeatureNames = rabbit_ct_helpers:get_app_env( - Config, - rabbit, forced_feature_flags_on_init, []), - FeatureNames1 = lists:usort(FeatureNames0 ++ OtherFeatureNames), - rabbit_ct_helpers:merge_app_env( - Config1, - {rabbit, [{forced_feature_flags_on_init, FeatureNames1}]}) - end. + {Config2, + FeatureNames0} = case skip_metadata_store_configuration(Config) of + true -> + ct:log( + "Skipping metadata store configuration as " + "requested"), + {Config, ?REQUIRED_FEATURE_FLAGS}; + false -> + ct:log("Configuring metadata store..."), + MetadataStore = configured_metadata_store( + Config), + Config1 = rabbit_ct_helpers:set_config( + Config, + {metadata_store, MetadataStore}), + case MetadataStore of + mnesia -> + ct:log("Enabling Mnesia metadata store"), + {Config1, + ?REQUIRED_FEATURE_FLAGS}; + khepri -> + ct:log("Enabling Khepri metadata store"), + {Config1, + [khepri_db | ?REQUIRED_FEATURE_FLAGS]} + end + end, + OtherFeatureNames = rabbit_ct_helpers:get_app_env( + Config2, + rabbit, forced_feature_flags_on_init, []), + FeatureNames1 = lists:usort(FeatureNames0 ++ OtherFeatureNames), + rabbit_ct_helpers:merge_app_env( + Config2, + {rabbit, [{forced_feature_flags_on_init, FeatureNames1}]}). skip_metadata_store_configuration(Config) -> Skip = rabbit_ct_helpers:get_config(