Skip to content

Commit b165adb

Browse files
committed
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.
1 parent 914810b commit b165adb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

deps/rabbitmq_ct_client_helpers/src/rabbit_ct_client_helpers.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ open_connection(Config, Node) ->
147147
Pid ! {open_connection, self()},
148148
receive
149149
Conn when is_pid(Conn) -> Conn
150+
after 60_000 ->
151+
ct:fail("Timed out waiting for connection to open")
150152
end.
151153

152154
open_unmanaged_connection(Config) ->

deps/rabbitmq_mqtt/test/shared_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ clean_session_kill_node(Config) ->
12591259
?assertEqual(0, rpc(Config, ets, info, [rabbit_durable_queue, size])).
12601260

12611261
rabbit_status_connection_count(Config) ->
1262-
_ = rabbit_ct_client_helpers:open_connection(Config, 0),
1262+
_Pid = rabbit_ct_client_helpers:open_connection(Config, 0),
12631263
C = connect(?FUNCTION_NAME, Config),
12641264

12651265
{ok, String} = rabbit_ct_broker_helpers:rabbitmqctl(Config, 0, ["status"]),

0 commit comments

Comments
 (0)