Skip to content

Commit dc63164

Browse files
committed
[Why]
This flaked today since the restart too 309ms, why above the allowed 100ms (outside of CI, it takes single-digit ms) [How] Increase the allowed time but also significantly increase next_seq_id. This test exists because in the past we had an O(n) algorithm in CQ recovery, leading to a slow recovery of even empty queues, if they had a very large next_seq_id. Now that this operation is O(1), a much larger next_seq_id shouldn't affect the time it takes to run this test, while accidentally re-intrudcing an O(n) algorithm should fail this test consistently.
1 parent 4e23f8d commit dc63164

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

deps/rabbit/test/backing_queue_SUITE.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,18 +1445,18 @@ variable_queue_restart_large_seq_id2(VQ0, QName) ->
14451445
Terms = variable_queue_read_terms(QName),
14461446
Count = proplists:get_value(next_seq_id, Terms),
14471447

1448-
%% set a very high next_seq_id as if 100M messages have been
1448+
%% set a very high next_seq_id as if 100 billion messages have been
14491449
%% published and consumed
1450-
Terms2 = lists:keyreplace(next_seq_id, 1, Terms, {next_seq_id, 100_000_000}),
1450+
Terms2 = lists:keyreplace(next_seq_id, 1, Terms, {next_seq_id, 100_000_000_000}),
14511451

14521452
{TInit, VQ3} =
14531453
timer:tc(
14541454
fun() -> variable_queue_init(test_amqqueue(QName, true), Terms2) end,
14551455
millisecond),
14561456
%% even with a very high next_seq_id start of an empty queue
1457-
%% should be quick (few milliseconds, but let's give it 100ms, to
1457+
%% should be quick (few milliseconds, but let's give it 500ms, to
14581458
%% avoid flaking on slow servers)
1459-
{true, _} = {TInit < 100, TInit},
1459+
{true, _} = {TInit < 500, TInit},
14601460

14611461
%% should be empty now
14621462
true = rabbit_variable_queue:is_empty(VQ3),

0 commit comments

Comments
 (0)