Skip to content

Commit c59218a

Browse files
committed
Skip 2 stream queue tests in mixed-version cluster testing
These 2 tests can fail in mixed-version, 2-node cluster testing. If the stream coordinator leader ends up on the lower version, it does not contain the fixes and the tests fail. With this commit, the 2 tests are skipped under the appropriate conditions. References #4133
1 parent 41dfc4d commit c59218a

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

deps/rabbit/test/rabbit_stream_queue_SUITE.erl

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,24 @@ end_per_group(_, Config) ->
192192
rabbit_ct_helpers:run_steps(Config,
193193
rabbit_ct_broker_helpers:teardown_steps()).
194194

195-
init_per_testcase(Testcase, Config) ->
196-
Config1 = rabbit_ct_helpers:testcase_started(Config, Testcase),
197-
Q = rabbit_data_coercion:to_binary(Testcase),
195+
init_per_testcase(TestCase, Config)
196+
when TestCase == receive_basic_cancel_on_queue_deletion
197+
orelse TestCase == keep_consuming_on_leader_restart ->
198+
ClusterSize = ?config(rmq_nodes_count, Config),
199+
case {rabbit_ct_helpers:is_mixed_versions(), ClusterSize} of
200+
{true, 2} ->
201+
%% These 2 tests fail because the leader can be the lower version,
202+
%% which does not have the fix.
203+
{skip, "not tested in mixed-version cluster and cluster size = 2"};
204+
_ ->
205+
init_test_case(TestCase, Config)
206+
end;
207+
init_per_testcase(TestCase, Config) ->
208+
init_test_case(TestCase, Config).
209+
210+
init_test_case(TestCase, Config) ->
211+
Config1 = rabbit_ct_helpers:testcase_started(Config, TestCase),
212+
Q = rabbit_data_coercion:to_binary(TestCase),
198213
Config2 = rabbit_ct_helpers:set_config(Config1, [{queue_name, Q}]),
199214
rabbit_ct_helpers:run_steps(Config2, rabbit_ct_client_helpers:setup_steps()).
200215

0 commit comments

Comments
 (0)