Skip to content

Commit cd5de9b

Browse files
Fix issue
Catch exception thrown by rabbit_ct_broker_helpers:enable_plugin
1 parent 136f18f commit cd5de9b

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

deps/rabbitmq_local_exchange/test/rabbit_local_exchange_SUITE.erl

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,21 @@ end_per_suite(Config) ->
4545
rabbit_ct_broker_helpers:teardown_steps()).
4646

4747
init_per_group(_, Config) ->
48-
Config.
48+
AnyNodeIsMissingPlugin =
49+
lists:any(
50+
fun (N) ->
51+
try
52+
rabbit_ct_broker_helpers:enable_plugin(Config, N, rabbitmq_local_exchange),
53+
false
54+
catch
55+
_:_ -> true
56+
end
57+
end,
58+
rabbit_ct_broker_helpers:get_node_configs(Config, nodename)),
59+
case AnyNodeIsMissingPlugin of
60+
true -> {skip, "rabbitmq_local_exchange plugin not available"};
61+
_ -> Config
62+
end.
4963

5064
end_per_group(_, Config) ->
5165
Config.
@@ -54,11 +68,6 @@ init_per_testcase(Testcase, Config) ->
5468
TestCaseName = rabbit_ct_helpers:config_to_testcase_name(Config, Testcase),
5569
Config1 = rabbit_ct_helpers:set_config(Config, {test_resource_name,
5670
re:replace(TestCaseName, "/", "-", [global, {return, list}])}),
57-
Nodes = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
58-
[case rabbit_ct_broker_helpers:enable_plugin(Config, N, rabbitmq_local_exchange) of
59-
ok -> ok;
60-
_ -> {skip}
61-
end || N <- Nodes],
6271
rabbit_ct_helpers:testcase_started(Config1, Testcase).
6372

6473
end_per_testcase(Testcase, Config) ->

0 commit comments

Comments
 (0)