Skip to content

Commit 0d8c50d

Browse files
HoloRinmergify-bot
authored andcommitted
Attempt to reduce test flakes in consistent_hash_exchange suite
(cherry picked from commit 078321c) (cherry picked from commit 6bc05fd) (cherry picked from commit 8dd3f6e)
1 parent 6cb9401 commit 0d8c50d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

deps/rabbitmq_consistent_hash_exchange/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ suites = [
5656
rabbitmq_integration_suite(
5757
PACKAGE,
5858
name = "rabbit_exchange_type_consistent_hash_SUITE",
59+
shard_count = 2,
5960
),
6061
]
6162

deps/rabbitmq_consistent_hash_exchange/test/rabbit_exchange_type_consistent_hash_SUITE.erl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
-include_lib("common_test/include/ct.hrl").
1414
-include_lib("amqp_client/include/amqp_client.hrl").
1515
-include_lib("eunit/include/eunit.hrl").
16+
-include_lib("rabbitmq_ct_helpers/include/rabbit_assert.hrl").
17+
18+
-define(DEFAULT_WAIT, 1000).
19+
-define(DEFAULT_INTERVAL, 100).
1620

1721
all() ->
1822
[
@@ -231,7 +235,7 @@ test0(Config, MakeMethod, MakeMsg, DeclareArgs, [Q1, Q2, Q3, Q4] = Queues, Itera
231235
MakeMethod(CHX),
232236
MakeMsg()) || _ <- lists:duplicate(IterationCount, const)],
233237
amqp_channel:wait_for_confirms(Chan, 300),
234-
timer:sleep(500),
238+
timer:sleep(1000),
235239

236240
Counts =
237241
[begin
@@ -431,7 +435,7 @@ test_hash_ring_updates_when_exclusive_queues_are_deleted_due_to_connection_closu
431435

432436
ct:pal("all hash ring rows after connection closure: ~p", [hash_ring_rows(Config)]),
433437

434-
?assertEqual(0, count_buckets_of_exchange(Config, X)),
438+
?awaitMatch(0, count_buckets_of_exchange(Config, X), ?DEFAULT_WAIT, ?DEFAULT_INTERVAL),
435439
clean_up_test_topology(Config, X, []),
436440
ok.
437441

@@ -488,7 +492,7 @@ test_hash_ring_updates_when_exclusive_queues_are_deleted_due_to_connection_closu
488492

489493
ct:pal("all hash ring rows after connection closure (~p): ~p", [XAsList, hash_ring_rows(Config)]),
490494

491-
?assertEqual(0, count_buckets_of_exchange(Config, X)),
495+
?awaitMatch(0, count_buckets_of_exchange(Config, X), ?DEFAULT_WAIT, ?DEFAULT_INTERVAL),
492496
clean_up_test_topology(Config, X, []),
493497
ok.
494498

0 commit comments

Comments
 (0)