Skip to content

Commit f51cc10

Browse files
committed
rabbitmq_ct_helpers: Make ignored crashes configurable
A testsuite just has to set: Config1 = rabbit_ct_helpers:set_config( Config, [{ignored_crashes, ["some fixed string pattern A", "some fixed string pattern B"]} ]),
1 parent 9dcf7c3 commit f51cc10

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,8 +1089,14 @@ stop_rabbitmq_nodes(Config) ->
10891089
case FindCrashes of
10901090
true ->
10911091
%% TODO: Make the ignore list configurable.
1092-
IgnoredCrashes = ["** force_vhost_failure"],
1093-
find_crashes_in_logs(NodeConfigs, IgnoredCrashes);
1092+
IgnoredCrashes0 = ["** force_vhost_failure"],
1093+
case rabbit_ct_helpers:get_config(Config, ignored_crashes) of
1094+
undefined ->
1095+
find_crashes_in_logs(NodeConfigs, IgnoredCrashes0);
1096+
IgnoredCrashes1 ->
1097+
find_crashes_in_logs(
1098+
NodeConfigs, IgnoredCrashes0 ++ IgnoredCrashes1)
1099+
end;
10941100
false ->
10951101
ok
10961102
end,
@@ -1172,7 +1178,11 @@ capture_gen_server_termination(
11721178
Ret = re:run(Line, Prefix ++ "( .*|\\*.*|)$", ReOpts),
11731179
case Ret of
11741180
{match, [Suffix]} ->
1175-
case lists:member(Suffix, IgnoredCrashes) of
1181+
Ignore = lists:any(
1182+
fun(IgnoredCrash) ->
1183+
string:find(Suffix, IgnoredCrash) =/= nomatch
1184+
end, IgnoredCrashes),
1185+
case Ignore of
11761186
false ->
11771187
capture_gen_server_termination(
11781188
Rest, Prefix, [Line | Acc], Count, IgnoredCrashes);

0 commit comments

Comments
 (0)