From def25bdaf9dd21683dbae95ca134efa23b35c1e5 Mon Sep 17 00:00:00 2001 From: Gao Binlong Date: Thu, 26 Sep 2024 13:32:54 +0800 Subject: [PATCH] Fix testHAProxyModeConnectionWorks is flaky Signed-off-by: Gao Binlong --- qa/remote-clusters/Dockerfile | 6 ++++++ qa/remote-clusters/docker-compose.yml | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 qa/remote-clusters/Dockerfile diff --git a/qa/remote-clusters/Dockerfile b/qa/remote-clusters/Dockerfile new file mode 100644 index 0000000000000..717a43f9abc87 --- /dev/null +++ b/qa/remote-clusters/Dockerfile @@ -0,0 +1,6 @@ +FROM haproxy:2.1.2 + +# Install netcat +RUN apt-get update && \ + apt-get install -y netcat-traditional && \ + rm -rf /var/lib/apt/lists/* diff --git a/qa/remote-clusters/docker-compose.yml b/qa/remote-clusters/docker-compose.yml index cf6aefcf5c1a3..87d18ea8ff0f5 100644 --- a/qa/remote-clusters/docker-compose.yml +++ b/qa/remote-clusters/docker-compose.yml @@ -67,8 +67,19 @@ services: timeout: 2s retries: 5 haproxy: + build: + context: . + dockerfile: Dockerfile image: haproxy:2.1.2 ports: - "9600" volumes: - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + depends_on: + - opensearch-2 + healthcheck: + test: ["CMD", "nc", "-z", "localhost", "9600"] + interval: 2s + timeout: 1s + retries: 5 + start_period: 15s