This is an automated email from the ASF dual-hosted git repository.

ashishtiwari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 08446d913 fix(ci): consul test cases run before cluster ready (#11041)
08446d913 is described below

commit 08446d9134a844343800f949faeb3249c6b11446
Author: xiangwei <[email protected]>
AuthorDate: Fri Mar 15 15:18:05 2024 +0800

    fix(ci): consul test cases run before cluster ready (#11041)
    
    * Fix executing consul2.t before cluster already
---
 ci/pod/docker-compose.first.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ci/pod/docker-compose.first.yml b/ci/pod/docker-compose.first.yml
index 622360638..d203a967d 100644
--- a/ci/pod/docker-compose.first.yml
+++ b/ci/pod/docker-compose.first.yml
@@ -66,6 +66,11 @@ services:
       - "8302:8302"
       - "9600:8600"
     command: [ "consul", "agent", "-server", "-bootstrap-expect=1", "-bind", 
"0.0.0.0", "-client", "0.0.0.0", "-node", "node-1", "-log-level", "info", 
"-data-dir=/consul/data", "-enable-script-checks" ]
+    healthcheck:
+        test: ["CMD", "curl", "-f", "http://localhost:8500/";]
+        interval: 10s
+        timeout: 10s
+        retries: 5
     networks:
       consul_cluster_net:
         aliases:
@@ -79,6 +84,9 @@ services:
     ports:
       - "9501:8500"
     command: [ "consul", "agent", "-server", "-bind", "0.0.0.0", "-client", 
"0.0.0.0", "-retry-join", "consul.cluster", "-node", "node-2", "-log-level", 
"info", "-data-dir=/consul/data", "-enable-script-checks" ]
+    depends_on:
+      consul_node_1:
+        condition: service_healthy
     networks:
       consul_cluster_net:
         aliases:
@@ -92,6 +100,9 @@ services:
     ports:
       - "9502:8500"
     command: [ "consul", "agent", "-server", "-bind", "0.0.0.0", "-client", 
"0.0.0.0", "-retry-join", "consul.cluster", "-node", "node-3", "-log-level", 
"info", "-data-dir=/consul/data", "-enable-script-checks" ]
+    depends_on:
+      consul_node_1:
+        condition: service_healthy
     networks:
       consul_cluster_net:
         aliases:

Reply via email to