@@ -121,8 +121,7 @@ end_per_testcase(_Test, _Config) ->
121
121
ok .
122
122
123
123
test_global_counters (Config ) ->
124
- Port = get_stream_port (Config ),
125
- test_server (gen_tcp , Port ),
124
+ test_server (gen_tcp , Config ),
126
125
? assertEqual (#{
127
126
publishers => 0 ,
128
127
consumers => 0 ,
@@ -153,14 +152,11 @@ test_global_counters(Config) ->
153
152
ok .
154
153
155
154
test_stream (Config ) ->
156
- Port = get_stream_port (Config ),
157
- test_server (gen_tcp , Port ),
155
+ test_server (gen_tcp , Config ),
158
156
ok .
159
157
160
158
test_stream_tls (Config ) ->
161
- Port = get_stream_port_tls (Config ),
162
- application :ensure_all_started (ssl ),
163
- test_server (ssl , Port ),
159
+ test_server (ssl , Config ),
164
160
ok .
165
161
166
162
test_gc_consumers (Config ) ->
@@ -313,7 +309,12 @@ get_node_name(Config) ->
313
309
get_node_name (Config , Node ) ->
314
310
rabbit_ct_broker_helpers :get_node_config (Config , Node , nodename ).
315
311
316
- test_server (Transport , Port ) ->
312
+ test_server (Transport , Config ) ->
313
+ Port = case Transport of
314
+ gen_tcp -> get_stream_port (Config );
315
+ ssl -> application :ensure_all_started (ssl ),
316
+ get_stream_port_tls (Config )
317
+ end ,
317
318
{ok , S } =
318
319
Transport :connect (" localhost" , Port ,
319
320
[{active , false }, {mode , binary }]),
@@ -324,11 +325,13 @@ test_server(Transport, Port) ->
324
325
C3 = test_create_stream (Transport , S , Stream , C2 ),
325
326
PublisherId = 42 ,
326
327
C4 = test_declare_publisher (Transport , S , PublisherId , Stream , C3 ),
328
+ ? assertMatch (#{publishers := 1 }, get_global_counters (Config )),
327
329
Body = <<" hello" >>,
328
330
C5 = test_publish_confirm (Transport , S , PublisherId , Body , C4 ),
329
331
C6 = test_publish_confirm (Transport , S , PublisherId , Body , C5 ),
330
332
SubscriptionId = 42 ,
331
333
C7 = test_subscribe (Transport , S , SubscriptionId , Stream , C6 ),
334
+ ? assertMatch (#{consumers := 1 }, get_global_counters (Config )),
332
335
C8 = test_deliver (Transport , S , SubscriptionId , 0 , Body , C7 ),
333
336
C9 = test_deliver (Transport , S , SubscriptionId , 1 , Body , C8 ),
334
337
C10 = test_delete_stream (Transport , S , Stream , C9 ),
0 commit comments