Add timeout for test AMQP 0.9.1 connection to open

We see sporadic test failures where a test case hangs in the
receive until the Bazel suite timeout is reached.

There is no point in a test case to wait forever for an AMQP 0.9.1
connection to establish. Let's time out after 1 minute.

This will make the test case fail faster.
This commit is contained in:
David Ansari 2023-02-16 17:53:09 +00:00
parent 914810b923
commit b165adb958
2 changed files with 3 additions and 1 deletions

View File

@ -147,6 +147,8 @@ open_connection(Config, Node) ->
Pid ! {open_connection, self()},
receive
Conn when is_pid(Conn) -> Conn
after 60_000 ->
ct:fail("Timed out waiting for connection to open")
end.
open_unmanaged_connection(Config) ->

View File

@ -1259,7 +1259,7 @@ clean_session_kill_node(Config) ->
?assertEqual(0, rpc(Config, ets, info, [rabbit_durable_queue, size])).
rabbit_status_connection_count(Config) ->
_ = rabbit_ct_client_helpers:open_connection(Config, 0),
_Pid = rabbit_ct_client_helpers:open_connection(Config, 0),
C = connect(?FUNCTION_NAME, Config),
{ok, String} = rabbit_ct_broker_helpers:rabbitmqctl(Config, 0, ["status"]),