14
14
15
15
-include (" src/amqp10_client.hrl" ).
16
16
17
- -compile (export_all ).
17
+ -compile ([ export_all , nowarn_export_all ] ).
18
18
19
- -define (UNAUTHORIZED_USER , <<" test_user_no_perm" >>).
20
-
21
- % % The latch constant defines how many processes are spawned in order
22
- % % to run certain functionality in parallel. It follows the standard
23
- % % countdown latch pattern.
24
- -define (LATCH , 100 ).
25
-
26
- % % The wait constant defines how long a consumer waits before it
27
- % % unsubscribes
28
- -define (WAIT , 200 ).
29
-
30
- % % How to long wait for a process to die after an expected failure
31
- -define (PROCESS_EXIT_TIMEOUT , 5000 ).
19
+ suite () ->
20
+ [{timetrap , {seconds , 120 }}].
32
21
33
22
all () ->
34
23
[
@@ -344,7 +333,7 @@ roundtrip(OpenConf, Body) ->
344
333
<<" test1" >>,
345
334
settled ,
346
335
unsettled_state ),
347
- {ok , OutMsg } = amqp10_client :get_msg (Receiver , 60000 * 5 ),
336
+ {ok , OutMsg } = amqp10_client :get_msg (Receiver , 60_000 * 4 ),
348
337
ok = amqp10_client :end_session (Session ),
349
338
ok = amqp10_client :close_connection (Connection ),
350
339
% ct:pal(?LOW_IMPORTANCE, "roundtrip message Out: ~tp~nIn: ~tp~n", [OutMsg, Msg]),
@@ -379,7 +368,7 @@ filtered_roundtrip(OpenConf, Body) ->
379
368
settled ,
380
369
unsettled_state ),
381
370
ok = amqp10_client :send_msg (Sender , Msg1 ),
382
- {ok , OutMsg1 } = amqp10_client :get_msg (DefaultReceiver , 60000 * 5 ),
371
+ {ok , OutMsg1 } = amqp10_client :get_msg (DefaultReceiver , 60_000 * 4 ),
383
372
? assertEqual (<<" msg-1-tag" >>, amqp10_msg :delivery_tag (OutMsg1 )),
384
373
385
374
timer :sleep (5 * 1000 ),
@@ -398,10 +387,10 @@ filtered_roundtrip(OpenConf, Body) ->
398
387
unsettled_state ,
399
388
#{<<" apache.org:selector-filter:string" >> => <<" amqp.annotation.x-opt-enqueuedtimeutc > " , Now2Binary /binary >>}),
400
389
401
- {ok , OutMsg2 } = amqp10_client :get_msg (DefaultReceiver , 60000 * 5 ),
390
+ {ok , OutMsg2 } = amqp10_client :get_msg (DefaultReceiver , 60_000 * 4 ),
402
391
? assertEqual (<<" msg-2-tag" >>, amqp10_msg :delivery_tag (OutMsg2 )),
403
392
404
- {ok , OutMsgFiltered } = amqp10_client :get_msg (FilteredReceiver , 60000 * 5 ),
393
+ {ok , OutMsgFiltered } = amqp10_client :get_msg (FilteredReceiver , 60_000 * 4 ),
405
394
? assertEqual (<<" msg-2-tag" >>, amqp10_msg :delivery_tag (OutMsgFiltered )),
406
395
407
396
ok = amqp10_client :end_session (Session ),
@@ -676,11 +665,13 @@ incoming_heartbeat(Config) ->
676
665
idle_time_out => 1000 , notify => self ()},
677
666
{ok , Connection } = amqp10_client :open_connection (CConf ),
678
667
receive
679
- {amqp10_event , {connection , Connection ,
680
- {closed , {resource_limit_exceeded , <<" remote idle-time-out" >>}}}} ->
668
+ {amqp10_event ,
669
+ {connection , Connection0 ,
670
+ {closed , {resource_limit_exceeded , <<" remote idle-time-out" >>}}}}
671
+ when Connection0 =:= Connection ->
681
672
ok
682
673
after 5000 ->
683
- exit (incoming_heartbeat_assert )
674
+ exit (incoming_heartbeat_assert )
684
675
end ,
685
676
demonitor (MockRef ).
686
677
@@ -704,25 +695,30 @@ publish_messages(Sender, Data, Num) ->
704
695
705
696
receive_one (Receiver ) ->
706
697
receive
707
- {amqp10_msg , Receiver , Msg } ->
698
+ {amqp10_msg , Receiver0 , Msg }
699
+ when Receiver0 =:= Receiver ->
708
700
amqp10_client :accept_msg (Receiver , Msg )
709
701
after 2000 ->
710
702
timeout
711
703
end .
712
704
713
705
await_disposition (DeliveryTag ) ->
714
706
receive
715
- {amqp10_disposition , {accepted , DeliveryTag }} -> ok
707
+ {amqp10_disposition , {accepted , DeliveryTag0 }}
708
+ when DeliveryTag0 =:= DeliveryTag -> ok
716
709
after 3000 ->
717
710
flush (),
718
711
exit (dispostion_timeout )
719
712
end .
720
713
721
714
await_link (Who , What , Err ) ->
722
715
receive
723
- {amqp10_event , {link , Who , What }} ->
716
+ {amqp10_event , {link , Who0 , What0 }}
717
+ when Who0 =:= Who andalso
718
+ What0 =:= What ->
724
719
ok ;
725
- {amqp10_event , {link , Who , {detached , Why }}} ->
720
+ {amqp10_event , {link , Who0 , {detached , Why }}}
721
+ when Who0 =:= Who ->
726
722
exit (Why )
727
723
after 5000 ->
728
724
flush (),
0 commit comments