@@ -83,27 +83,29 @@ end_per_testcase(Testcase, Config) ->
83
83
% % Test cases
84
84
% % -------------------------------------------------------------------
85
85
86
- -define (Qs , [<<" q0" >>, <<" q1" >>, <<" q2" >>, <<" q3" >>, <<" q4" >>, <<" q5" >>, <<" q6" >>,
87
- <<" e-q0" >>, <<" e-q1" >>, <<" e-q2" >>, <<" e-q3" >>, <<" e-q4" >>, <<" e-q5" >>, <<" e-q6" >>,
88
- <<" d-q0" >>, <<" d-q1" >>, <<" d-q2" >>, <<" d-q3" >>, <<" d-q4" >>, <<" d-q5" >>, <<" d-q6" >>]).
86
+ -define (AllQs , [<<" q0" >>, <<" q1" >>, <<" q2" >>, <<" q3" >>, <<" q4" >>, <<" q5" >>, <<" q6" >>,
87
+ <<" e-q0" >>, <<" e-q1" >>, <<" e-q2" >>, <<" e-q3" >>, <<" e-q4" >>, <<" e-q5" >>, <<" e-q6" >>,
88
+ <<" d-q0" >>, <<" d-q1" >>, <<" d-q2" >>, <<" d-q3" >>, <<" d-q4" >>, <<" d-q5" >>, <<" d-q6" >>]).
89
+ -define (RoutingTestQs , [<<" q0" >>, <<" q1" >>, <<" q2" >>, <<" q3" >>]).
90
+
89
91
% % N.B. lowering this value below 100K increases the probability
90
92
% % of failing the Chi squared test in some environments
91
93
-define (DEFAULT_SAMPLE_COUNT , 150000 ).
92
94
93
95
routing_key_hashing_test (Config ) ->
94
- ok = test_with_rk (Config , ? Qs ).
96
+ ok = test_with_rk (Config , ? RoutingTestQs ).
95
97
96
98
custom_header_hashing_test (Config ) ->
97
- ok = test_with_header (Config , ? Qs ).
99
+ ok = test_with_header (Config , ? RoutingTestQs ).
98
100
99
101
message_id_hashing_test (Config ) ->
100
- ok = test_with_message_id (Config , ? Qs ).
102
+ ok = test_with_message_id (Config , ? RoutingTestQs ).
101
103
102
104
correlation_id_hashing_test (Config ) ->
103
- ok = test_with_correlation_id (Config , ? Qs ).
105
+ ok = test_with_correlation_id (Config , ? RoutingTestQs ).
104
106
105
107
timestamp_hashing_test (Config ) ->
106
- ok = test_with_timestamp (Config , ? Qs ).
108
+ ok = test_with_timestamp (Config , ? RoutingTestQs ).
107
109
108
110
other_routing_test (Config ) ->
109
111
ok = test_binding_with_negative_routing_key (Config ),
@@ -193,8 +195,8 @@ rnd() ->
193
195
rnd_int () ->
194
196
rand :uniform (10000000 ).
195
197
196
- test0 (Config , MakeMethod , MakeMsg , DeclareArgs , [ Q1 , Q2 , Q3 , Q4 ] = Queues ) ->
197
- test0 (Config , MakeMethod , MakeMsg , DeclareArgs , [ Q1 , Q2 , Q3 , Q4 ] = Queues , ? DEFAULT_SAMPLE_COUNT ).
198
+ test0 (Config , MakeMethod , MakeMsg , DeclareArgs , Queues ) ->
199
+ test0 (Config , MakeMethod , MakeMsg , DeclareArgs , Queues , ? DEFAULT_SAMPLE_COUNT ).
198
200
199
201
test0 (Config , MakeMethod , MakeMsg , DeclareArgs , [Q1 , Q2 , Q3 , Q4 ] = Queues , IterationCount ) ->
200
202
Chan = rabbit_ct_client_helpers :open_channel (Config , 0 ),
@@ -343,9 +345,6 @@ test_hash_ring_updates_when_multiple_queues_are_deleted(Config) ->
343
345
type = <<" x-consistent-hash" >>},
344
346
# 'exchange.declare_ok' {} = amqp_channel :call (Chan , Declare ),
345
347
346
- ct :pal (" all hash ring rows before declaration: ~p " ,
347
- [hash_ring_rows (Config )]),
348
-
349
348
Queues = [<<" d-q1" >>, <<" d-q2" >>, <<" d-q3" >>],
350
349
[# 'queue.declare_ok' {} =
351
350
amqp_channel :call (Chan , # 'queue.declare' {
@@ -356,8 +355,6 @@ test_hash_ring_updates_when_multiple_queues_are_deleted(Config) ->
356
355
routing_key = <<" 3" >>})
357
356
|| Q <- Queues ],
358
357
359
- ct :pal (" all hash ring rows: ~p " , [hash_ring_rows (Config )]),
360
-
361
358
? assertEqual (9 , count_buckets_of_exchange (Config , X )),
362
359
assert_ring_consistency (Config , X ),
363
360
@@ -394,11 +391,15 @@ test_hash_ring_updates_when_exclusive_queues_are_deleted_due_to_connection_closu
394
391
routing_key = <<" 3" >>})
395
392
|| Q <- Queues ],
396
393
394
+ ct :pal (" all hash ring rows: ~p " , [hash_ring_rows (Config )]),
395
+
397
396
? assertEqual (18 , count_buckets_of_exchange (Config , X )),
398
397
assert_ring_consistency (Config , X ),
399
398
ok = amqp_connection :close (Conn ),
400
399
timer :sleep (500 ),
401
400
401
+ ct :pal (" all hash ring rows after connection closure: ~p " , [hash_ring_rows (Config )]),
402
+
402
403
? assertEqual (0 , count_buckets_of_exchange (Config , X )),
403
404
clean_up_test_topology (Config , X , []),
404
405
ok .
@@ -504,7 +505,7 @@ count_all_hash_ring_buckets(Config) ->
504
505
lists :foldl (fun (# chx_hash_ring {bucket_map = M }, Acc ) -> Acc + maps :size (M ) end , 0 , Rows ).
505
506
506
507
clean_up_test_topology (Config ) ->
507
- clean_up_test_topology (Config , none , ? Qs ).
508
+ clean_up_test_topology (Config , none , ? AllQs ).
508
509
509
510
clean_up_test_topology (Config , none , Qs ) ->
510
511
Ch = rabbit_ct_client_helpers :open_channel (Config , 0 ),
0 commit comments