Skip to content

Commit 6515471

Browse files
authored
Merge pull request #14742 from rabbitmq/set-of-small-fixes-here-and-there
Collection of test fixes (2025Q4)
2 parents 1dd2508 + 274ef7d commit 6515471

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

deps/rabbit/src/rabbit_access_control.erl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ is_auth_backend_module_enabled(Mod) when is_atom(Mod) ->
113113
case rabbit_plugins:which_plugin(Mod) of
114114
{ok, PluginName} ->
115115
%% FIXME: The definition of an "enabled plugin" in
116-
%% `rabbit_plugins' varies from funtion to function.
116+
%% `rabbit_plugins' varies from function to function.
117117
%% Sometimes, it means the "rabbitmq-plugin enable
118118
%% <plugin>" was executed, sometimes it means the plugin
119119
%% is running.
@@ -141,7 +141,7 @@ is_auth_backend_module_enabled(Mod) when is_atom(Mod) ->
141141
"it will be skipped during "
142142
"authentication/authorization",
143143
[Mod, PluginName]),
144-
false
144+
is_test_auth_backend_module(Mod)
145145
end;
146146
{error, no_provider} ->
147147
?LOG_INFO(
@@ -150,10 +150,14 @@ is_auth_backend_module_enabled(Mod) when is_atom(Mod) ->
150150
"module. Until then it will be skipped during "
151151
"authentication/authorization",
152152
[Mod]),
153-
false
153+
is_test_auth_backend_module(Mod)
154154
end
155155
end.
156156

157+
is_test_auth_backend_module(Mod) ->
158+
Mods = application:get_env(rabbit, test_auth_backends, []),
159+
lists:member(Mod, Mods).
160+
157161
-spec check_user_pass_login
158162
(rabbit_types:username(), rabbit_types:password()) ->
159163
{'ok', rabbit_types:user()} |

deps/rabbit/test/rabbit_fifo_dlx_integration_SUITE.erl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,12 @@ end_per_testcase(Testcase, Config) ->
158158
delete_queue(Ch, ?config(target_queue_6, Config)),
159159
#'exchange.delete_ok'{} = amqp_channel:call(Ch, #'exchange.delete'{exchange = ?config(dead_letter_exchange, Config)}),
160160

161-
DlxWorkers = rabbit_ct_broker_helpers:rpc_all(Config, supervisor, which_children, [rabbit_fifo_dlx_sup]),
162-
?assert(lists:all(fun(L) -> L =:= [] end, DlxWorkers)),
161+
?awaitMatch(
162+
true,
163+
begin
164+
DlxWorkers = rabbit_ct_broker_helpers:rpc_all(Config, supervisor, which_children, [rabbit_fifo_dlx_sup]),
165+
lists:all(fun(L) -> L =:= [] end, DlxWorkers)
166+
end, 60000),
163167

164168
Config1 = rabbit_ct_helpers:run_steps(
165169
Config,
@@ -960,7 +964,7 @@ single_dlx_worker(Config) ->
960964
assert_active_dlx_workers(1, Config, Leader1).
961965

962966
assert_active_dlx_workers(N, Config, Server) ->
963-
?assertEqual(N, length(rpc(Config, Server, supervisor, which_children, [rabbit_fifo_dlx_sup], 2000))).
967+
?awaitMatch(N, length(rpc(Config, Server, supervisor, which_children, [rabbit_fifo_dlx_sup], 2000)), 60000).
964968

965969
declare_queue(Channel, Queue, Args) ->
966970
#'queue.declare_ok'{} = amqp_channel:call(Channel, #'queue.declare'{

deps/rabbitmq_mqtt/test/auth_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ auth_config(T) when T == client_id_propagation;
251251
T == ssl_user_with_client_id_in_cert_san_email;
252252
T == ssl_user_with_client_id_in_cert_dn ->
253253
{rabbit, [
254-
{auth_backends, [rabbit_auth_backend_mqtt_mock]}
254+
{auth_backends, [rabbit_auth_backend_mqtt_mock]},
255+
{test_auth_backends, [rabbit_auth_backend_mqtt_mock]}
255256
]
256257
};
257258

deps/rabbitmq_mqtt/test/config_schema_SUITE.erl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ all() ->
2121
init_per_suite(Config) ->
2222
rabbit_ct_helpers:log_environment(),
2323
Config1 = rabbit_ct_helpers:run_setup_steps(Config),
24-
rabbit_ct_config_schema:init_schemas(rabbitmq_mqtt, Config1).
24+
case Config1 of
25+
_ when is_list(Config1) ->
26+
rabbit_ct_config_schema:init_schemas(rabbitmq_mqtt, Config1);
27+
{skip, _} ->
28+
Config1
29+
end.
2530

2631

2732
end_per_suite(Config) ->
@@ -37,8 +42,13 @@ init_per_testcase(Testcase, Config) ->
3742
Config1,
3843
rabbit_ct_broker_helpers:setup_steps() ++
3944
rabbit_ct_client_helpers:setup_steps()),
40-
util:enable_plugin(Config2, rabbitmq_mqtt),
41-
Config2.
45+
case Config2 of
46+
_ when is_list(Config2) ->
47+
util:enable_plugin(Config2, rabbitmq_mqtt),
48+
Config2;
49+
{skip, _} ->
50+
Config2
51+
end.
4252

4353
end_per_testcase(Testcase, Config) ->
4454
Config1 = rabbit_ct_helpers:run_steps(Config,

0 commit comments

Comments
 (0)