@@ -4597,19 +4597,8 @@ plugin(Config) ->
45974597idle_time_out_on_server (Config ) ->
45984598 App = rabbit ,
45994599 Par = heartbeat ,
4600- {ok , DefaultVal } = rpc (Config , application , get_env , [App , Par ]),
4601- % % Configure RabbitMQ to use an idle-time-out of 1 second.
4602- ok = rpc (Config , application , set_env , [App , Par , 1 ]),
4603-
4604- OpnConf = connection_config (Config ),
4605- {ok , Connection } = amqp10_client :open_connection (OpnConf ),
4606- receive {amqp10_event , {connection , Connection , opened }} -> ok
4607- after 30000 -> ct :fail ({missing_event , ? LINE })
4608- end ,
4609-
4610- % % Mock the server socket to not have received any bytes.
4611- rabbit_ct_broker_helpers :setup_meck (Config ),
46124600 Mod = rabbit_net ,
4601+ <<<<<<< HEAD
46134602 ok = rpc (Config , meck , new , [Mod , [no_link , passthrough ]]),
46144603 ok = rpc (Config , meck , expect , [Mod , getstat , 2 , {ok , [{recv_oct , 999 }]}]),
46154604 % % The server "SHOULD try to gracefully close the connection using a close
@@ -4625,10 +4614,46 @@ idle_time_out_on_server(Config) ->
46254614 after 30000 ->
46264615 ct :fail ({missing_event , ? LINE })
46274616 end ,
4628-
4629- ? assert (rpc (Config , meck , validate , [Mod ])),
4630- ok = rpc (Config , meck , unload , [Mod ]),
4631- ok = rpc (Config , application , set_env , [App , Par , DefaultVal ]).
4617+ =======
4618+ {ok , DefaultVal } = rpc (Config , application , get_env , [App , Par ]),
4619+ try
4620+ % % Configure RabbitMQ to use an idle-time-out of 1 second.
4621+ ok = rpc (Config , application , set_env , [App , Par , 1 ]),
4622+
4623+ OpnConf = connection_config (Config ),
4624+ {ok , Connection } = amqp10_client :open_connection (OpnConf ),
4625+ receive {amqp10_event , {connection , Connection , opened }} -> ok
4626+ after 30000 -> ct :fail ({missing_event , ? LINE })
4627+ end ,
4628+ >>>>>>> 608405518 (amqp_client_SUITE : Ensure `idle_time_out_on_server ` restores heartbeat value )
4629+
4630+ % % Mock the server socket to not have received any bytes.
4631+ rabbit_ct_broker_helpers :setup_meck (Config ),
4632+ ok = rpc (Config , meck , new , [Mod , [no_link , passthrough ]]),
4633+ ok = rpc (Config , meck , expect , [Mod , getstat , fun (_Sock , [recv_oct ]) ->
4634+ {ok , [{recv_oct , 999 }]};
4635+ (Sock , Opts ) ->
4636+ meck :passthrough ([Sock , Opts ])
4637+ end ]),
4638+
4639+ % % The server "SHOULD try to gracefully close the connection using a close
4640+ % % frame with an error explaining why" [2.4.5].
4641+ % % Since we chose a heartbeat value of 1 second, the server should easily
4642+ % % close the connection within 5 seconds.
4643+ receive
4644+ {amqp10_event ,
4645+ {connection , Connection ,
4646+ {closed ,
4647+ {resource_limit_exceeded ,
4648+ <<" no frame received from client within idle timeout threshold" >>}}}} -> ok
4649+ after 30000 ->
4650+ ct :fail ({missing_event , ? LINE })
4651+ end
4652+ after
4653+ ? assert (rpc (Config , meck , validate , [Mod ])),
4654+ ok = rpc (Config , meck , unload , [Mod ]),
4655+ ok = rpc (Config , application , set_env , [App , Par , DefaultVal ])
4656+ end .
46324657
46334658% % Test that the idle timeout threshold is exceeded on the client
46344659% % when no frames are sent from server to client.
0 commit comments