Skip to content

Commit 7a8669e

Browse files
committed
Improve cluster_minority_SUITE
This is a mix of a few changes: * Suppress the compiler warning from the export_all attribute. * Lower Khepri's command handling timeout value. By default this is set to 30s in rabbit which makes each of the cases in `client_operations` take an excessively long time. Before this change the suite took around 10 minutes to complete. Now it takes between two and three minutes. * Swap the order of client and broker teardown steps in end_per_group hook. The client teardown steps will always fail if run after the broker teardown steps because they rely on a value in `Config` that is deleted by broker teardown.
1 parent 8f8170d commit 7a8669e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

deps/rabbit/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ rabbitmq_integration_suite(
11621162

11631163
rabbitmq_integration_suite(
11641164
name = "cluster_minority_SUITE",
1165-
size = "large",
1165+
size = "medium",
11661166
additional_beam = [
11671167
":test_clustering_utils_beam",
11681168
],

deps/rabbit/test/cluster_minority_SUITE.erl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-include_lib("amqp_client/include/amqp_client.hrl").
1111
-include_lib("eunit/include/eunit.hrl").
1212

13-
-compile(export_all).
13+
-compile([export_all, nowarn_export_all]).
1414

1515
all() ->
1616
[
@@ -88,6 +88,14 @@ init_per_group(Group, Config0) when Group == client_operations;
8888
#'queue.declare_ok'{} = amqp_channel:call(Ch, #'queue.declare'{queue = <<"test-queue">>,
8989
arguments = [{<<"x-queue-type">>, longstr, <<"classic">>}]}),
9090

91+
%% Lower the default Khepri command timeout. By default this is set
92+
%% to 30s in `rabbit_khepri:setup/1' which makes the cases in this
93+
%% group run unnecessarily slow.
94+
[ok = rabbit_ct_broker_helpers:rpc(
95+
Config1, N,
96+
application, set_env,
97+
[khepri, default_timeout, 100]) || N <- lists:seq(0, 4)],
98+
9199
%% Create partition
92100
partition_5_node_cluster(Config1),
93101
Config1
@@ -104,8 +112,8 @@ init_per_group(Group, Config0) ->
104112

105113
end_per_group(_, Config) ->
106114
rabbit_ct_helpers:run_steps(Config,
107-
rabbit_ct_broker_helpers:teardown_steps() ++
108-
rabbit_ct_client_helpers:teardown_steps()).
115+
rabbit_ct_client_helpers:teardown_steps() ++
116+
rabbit_ct_broker_helpers:teardown_steps()).
109117

110118
init_per_testcase(Testcase, Config) ->
111119
rabbit_ct_helpers:testcase_started(Config, Testcase).

0 commit comments

Comments
 (0)