16
16
17
17
-compile ([export_all , nowarn_export_all ]).
18
18
19
- -define (TOUT , 30000 ).
19
+ -define (TIMEOUT , 30000 ).
20
20
21
21
suite () ->
22
22
[{timetrap , {minutes , 4 }}].
@@ -186,7 +186,7 @@ open_close_connection(Config) ->
186
186
{ok , Connection2 } = amqp10_client :open_connection (OpnConf ),
187
187
receive
188
188
{amqp10_event , {connection , Connection2 , opened }} -> ok
189
- after ? TOUT -> exit (connection_timeout )
189
+ after ? TIMEOUT -> exit (connection_timeout )
190
190
end ,
191
191
ok = amqp10_client :close_connection (Connection2 ),
192
192
ok = amqp10_client :close_connection (Connection ).
@@ -203,7 +203,7 @@ open_connection_plain_sasl(Config) ->
203
203
{ok , Connection } = amqp10_client :open_connection (OpnConf ),
204
204
receive
205
205
{amqp10_event , {connection , Connection , opened }} -> ok
206
- after ? TOUT -> exit (connection_timeout )
206
+ after ? TIMEOUT -> exit (connection_timeout )
207
207
end ,
208
208
ok = amqp10_client :close_connection (Connection ).
209
209
@@ -227,7 +227,7 @@ open_connection_plain_sasl_parse_uri(Config) ->
227
227
{ok , Connection } = amqp10_client :open_connection (OpnConf ),
228
228
receive
229
229
{amqp10_event , {connection , Connection , opened }} -> ok
230
- after ? TOUT -> exit (connection_timeout )
230
+ after ? TIMEOUT -> exit (connection_timeout )
231
231
end ,
232
232
ok = amqp10_client :close_connection (Connection ).
233
233
@@ -247,7 +247,7 @@ open_connection_plain_sasl_failure(Config) ->
247
247
% some implementation may simply close the tcp_connection
248
248
{amqp10_event , {connection , Connection , {closed , shutdown }}} -> ok
249
249
250
- after ? TOUT ->
250
+ after ? TIMEOUT ->
251
251
ct :pal (" Connection process is alive? = ~tp~n " ,
252
252
[erlang :is_process_alive (Connection )]),
253
253
exit (connection_timeout )
@@ -471,27 +471,27 @@ notify_with_performative(Config) ->
471
471
472
472
{ok , Connection } = amqp10_client :open_connection (OpenConf ),
473
473
receive {amqp10_event , {connection , Connection , {opened , # 'v1_0.open' {}}}} -> ok
474
- after ? TOUT -> ct :fail ({missing_event , ? LINE })
474
+ after ? TIMEOUT -> ct :fail ({missing_event , ? LINE })
475
475
end ,
476
476
477
477
{ok , Session1 } = amqp10_client :begin_session (Connection ),
478
478
receive {amqp10_event , {session , Session1 , {begun , # 'v1_0.begin' {}}}} -> ok
479
- after ? TOUT -> ct :fail ({missing_event , ? LINE })
479
+ after ? TIMEOUT -> ct :fail ({missing_event , ? LINE })
480
480
end ,
481
481
482
482
{ok , Sender1 } = amqp10_client :attach_sender_link (Session1 , <<" sender 1" >>, <<" /exchanges/amq.fanout" >>),
483
483
receive {amqp10_event , {link , Sender1 , {attached , # 'v1_0.attach' {}}}} -> ok
484
- after ? TOUT -> ct :fail ({missing_event , ? LINE })
484
+ after ? TIMEOUT -> ct :fail ({missing_event , ? LINE })
485
485
end ,
486
486
487
487
ok = amqp10_client :detach_link (Sender1 ),
488
488
receive {amqp10_event , {link , Sender1 , {detached , # 'v1_0.detach' {}}}} -> ok
489
- after ? TOUT -> ct :fail ({missing_event , ? LINE })
489
+ after ? TIMEOUT -> ct :fail ({missing_event , ? LINE })
490
490
end ,
491
491
492
492
ok = amqp10_client :end_session (Session1 ),
493
493
receive {amqp10_event , {session , Session1 , {ended , # 'v1_0.end' {}}}} -> ok
494
- after ? TOUT -> ct :fail ({missing_event , ? LINE })
494
+ after ? TIMEOUT -> ct :fail ({missing_event , ? LINE })
495
495
end ,
496
496
497
497
% % Test that the amqp10_client:*_sync functions work.
@@ -503,7 +503,7 @@ notify_with_performative(Config) ->
503
503
504
504
ok = amqp10_client :close_connection (Connection ),
505
505
receive {amqp10_event , {connection , Connection , {closed , # 'v1_0.close' {}}}} -> ok
506
- after ? TOUT -> ct :fail ({missing_event , ? LINE })
506
+ after ? TIMEOUT -> ct :fail ({missing_event , ? LINE })
507
507
end .
508
508
509
509
% a message is sent before the link attach is guaranteed to
@@ -602,13 +602,13 @@ subscribe(Config) ->
602
602
[begin
603
603
receive {amqp10_msg , Receiver , Msg } ->
604
604
ok = amqp10_client :accept_msg (Receiver , Msg )
605
- after ? TOUT -> ct :fail (timeout )
605
+ after ? TIMEOUT -> ct :fail (timeout )
606
606
end
607
607
end || _ <- lists :seq (1 , 10 )],
608
608
ok = assert_no_message (Receiver ),
609
609
610
610
receive {amqp10_event , {link , Receiver , credit_exhausted }} -> ok
611
- after ? TOUT -> flush (),
611
+ after ? TIMEOUT -> flush (),
612
612
exit (credit_exhausted_assert )
613
613
end ,
614
614
@@ -856,7 +856,7 @@ multi_transfer_without_delivery_id(Config) ->
856
856
receive
857
857
{amqp10_msg , Receiver , _InMsg } ->
858
858
ok
859
- after ? TOUT ->
859
+ after ? TIMEOUT ->
860
860
exit (delivery_timeout )
861
861
end ,
862
862
@@ -911,7 +911,7 @@ incoming_heartbeat(Config) ->
911
911
{closed , _ }}}
912
912
when Connection0 =:= Connection ->
913
913
ok
914
- after ? TOUT ->
914
+ after ? TIMEOUT ->
915
915
exit (incoming_heartbeat_assert )
916
916
end ,
917
917
demonitor (MockRef ).
@@ -928,7 +928,7 @@ await_link(Who, What, Err) ->
928
928
{amqp10_event , {link , Who0 , {detached , Why }}}
929
929
when Who0 =:= Who ->
930
930
ct :fail (Why )
931
- after ? TOUT ->
931
+ after ? TIMEOUT ->
932
932
flush (),
933
933
ct :fail (Err )
934
934
end .
@@ -945,7 +945,7 @@ await_disposition(DeliveryTag) ->
945
945
receive
946
946
{amqp10_disposition , {accepted , DeliveryTag0 }}
947
947
when DeliveryTag0 =:= DeliveryTag -> ok
948
- after ? TOUT ->
948
+ after ? TIMEOUT ->
949
949
flush (),
950
950
ct :fail (dispostion_timeout )
951
951
end .
@@ -970,7 +970,7 @@ receive_messages0(Receiver, N, Acc) ->
970
970
receive
971
971
{amqp10_msg , Receiver , Msg } ->
972
972
receive_messages0 (Receiver , N - 1 , [Msg | Acc ])
973
- after ? TOUT ->
973
+ after ? TIMEOUT ->
974
974
LastReceivedMsg = case Acc of
975
975
[] -> none ;
976
976
[M | _ ] -> M
0 commit comments