Skip to content

Commit c23c632

Browse files
committed
Fix etcd test failures
Running ``` make -C deps/rabbitmq_peer_discovery_etcd ct-system ``` on some macOS system causes test failures because the client cannot connect to etcd: ``` test failed to connect [localhost:2379] by <Gun Down> {down, {shutdown, econnrefused}} ``` The etcd log file didn't show any error message. However, the etcd log file showed that the etcd listener got started after the test case tried to connect. This commit fixes the test failure. A better solution would be to use the HTTP API or the etcdctl CLI to poll the listener status. However, simply waiting for 2 seconds is good enough for this test suite.
1 parent f9257e8 commit c23c632

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

deps/rabbitmq_peer_discovery_etcd/test/system_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ start_etcd(Config) ->
203203
"--initial-cluster-token", "test-token",
204204
"--log-level", "debug", "--log-outputs", "stdout"],
205205
EtcdPid = spawn(fun() -> rabbit_ct_helpers:exec(Cmd) end),
206+
%% Wait for etcd to start its listeners.
207+
timer:sleep(2000),
206208

207209
EtcdEndpoint = rabbit_misc:format("~s:~b", [EtcdHost, EtcdClientPort]),
208210
rabbit_ct_helpers:set_config(

0 commit comments

Comments
 (0)