You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2021/07/16 01:13:23 UTC

[apisix] branch master updated: test: ensure apisix containers recover in test_etcd_healthcheck.t (#4597)

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

spacewander 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 3f29573  test: ensure apisix containers recover in test_etcd_healthcheck.t (#4597)
3f29573 is described below

commit 3f295731b5c8a990ee9251fa613ed3f14691a481
Author: Shuyang Wu <wo...@gmail.com>
AuthorDate: Thu Jul 15 21:13:15 2021 -0400

    test: ensure apisix containers recover in test_etcd_healthcheck.t (#4597)
---
 t/cli/test_etcd_healthcheck.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/t/cli/test_etcd_healthcheck.sh b/t/cli/test_etcd_healthcheck.sh
index 62498f1..f94b8f6 100755
--- a/t/cli/test_etcd_healthcheck.sh
+++ b/t/cli/test_etcd_healthcheck.sh
@@ -25,6 +25,10 @@ ETCD_NAME_1=etcd1
 ETCD_NAME_2=etcd2
 HEALTH_CHECK_RETRY_TIMEOUT=10
 
+if [ -z "logs/error.log" ]; then
+    git checkout logs/error.log
+fi
+
 echo '
 etcd:
   host:
@@ -76,7 +80,7 @@ docker start ${ETCD_NAME_0} && docker start ${ETCD_NAME_1} && docker start ${ETC
 
 # sleep till etcd health check try to check again
 current_time=$(date +%s)
-sleep_seconds=$(( $sleep_till - $current_time ))
+sleep_seconds=$(( $sleep_till - $current_time + 3))
 if [ "$sleep_seconds" -gt 0 ]; then
     sleep $sleep_seconds
 fi
@@ -84,6 +88,8 @@ fi
 code=$(curl -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1')
 if [ ! $code -eq 200 ]; then
     echo "failed: apisix could not recover when etcd node recover"
+    docker ps
+    cat logs/error.log
     exit 1
 fi