Skip to content

Commit

Permalink
Fix etcd test failures
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ansd committed Dec 19, 2024
1 parent f9257e8 commit c23c632
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deps/rabbitmq_peer_discovery_etcd/test/system_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ start_etcd(Config) ->
"--initial-cluster-token", "test-token",
"--log-level", "debug", "--log-outputs", "stdout"],
EtcdPid = spawn(fun() -> rabbit_ct_helpers:exec(Cmd) end),
%% Wait for etcd to start its listeners.
timer:sleep(2000),

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

0 comments on commit c23c632

Please sign in to comment.