Skip to content

Commit 8fe2917

Browse files
committed
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.
1 parent a8c8cf2 commit 8fe2917

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,31 +1051,38 @@ configured_metadata_store(Config) ->
10511051
end.
10521052

10531053
configure_metadata_store(Config) ->
1054-
case skip_metadata_store_configuration(Config) of
1055-
true ->
1056-
ct:log("Skipping metadata store configuration as requested"),
1057-
Config;
1058-
false ->
1059-
ct:log("Configuring metadata store..."),
1060-
MetadataStore = configured_metadata_store(Config),
1061-
Config1 = rabbit_ct_helpers:set_config(
1062-
Config, {metadata_store, MetadataStore}),
1063-
FeatureNames0 = case MetadataStore of
1064-
mnesia ->
1065-
ct:log("Enabling Mnesia metadata store"),
1066-
?REQUIRED_FEATURE_FLAGS;
1067-
khepri ->
1068-
ct:log("Enabling Khepri metadata store"),
1069-
[khepri_db | ?REQUIRED_FEATURE_FLAGS]
1070-
end,
1071-
OtherFeatureNames = rabbit_ct_helpers:get_app_env(
1072-
Config,
1073-
rabbit, forced_feature_flags_on_init, []),
1074-
FeatureNames1 = lists:usort(FeatureNames0 ++ OtherFeatureNames),
1075-
rabbit_ct_helpers:merge_app_env(
1076-
Config1,
1077-
{rabbit, [{forced_feature_flags_on_init, FeatureNames1}]})
1078-
end.
1054+
{Config2,
1055+
FeatureNames0} = case skip_metadata_store_configuration(Config) of
1056+
true ->
1057+
ct:log(
1058+
"Skipping metadata store configuration as "
1059+
"requested"),
1060+
{Config, ?REQUIRED_FEATURE_FLAGS};
1061+
false ->
1062+
ct:log("Configuring metadata store..."),
1063+
MetadataStore = configured_metadata_store(
1064+
Config),
1065+
Config1 = rabbit_ct_helpers:set_config(
1066+
Config,
1067+
{metadata_store, MetadataStore}),
1068+
case MetadataStore of
1069+
mnesia ->
1070+
ct:log("Enabling Mnesia metadata store"),
1071+
{Config1,
1072+
?REQUIRED_FEATURE_FLAGS};
1073+
khepri ->
1074+
ct:log("Enabling Khepri metadata store"),
1075+
{Config1,
1076+
[khepri_db | ?REQUIRED_FEATURE_FLAGS]}
1077+
end
1078+
end,
1079+
OtherFeatureNames = rabbit_ct_helpers:get_app_env(
1080+
Config2,
1081+
rabbit, forced_feature_flags_on_init, []),
1082+
FeatureNames1 = lists:usort(FeatureNames0 ++ OtherFeatureNames),
1083+
rabbit_ct_helpers:merge_app_env(
1084+
Config2,
1085+
{rabbit, [{forced_feature_flags_on_init, FeatureNames1}]}).
10791086

10801087
skip_metadata_store_configuration(Config) ->
10811088
Skip = rabbit_ct_helpers:get_config(

0 commit comments

Comments
 (0)