Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed May 20, 2024
1 parent 9e37647 commit c2e7829
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -465,3 +465,10 @@ ci-env-down:
rm $(OTEL_CONFIG)
$(ENV_DOCKER_COMPOSE) down
@$(call func_echo_success_status, "$@ -> [ Done ]")

### ci-env-stop : CI env temporary stop
.PHONY: ci-env-stop
ci-env-stop:
@$(call func_echo_status, "$@ -> [ Start ]")
$(ENV_DOCKER_COMPOSE) stop
@$(call func_echo_success_status, "$@ -> [ Done ]")
10 changes: 5 additions & 5 deletions t/cli/test_etcd_sync_event_handle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ nginx_config:
make init
make run

# Test request
# Test request
curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:9080/1 | grep 503 || (echo "Round 1 Request 1 unexpected"; exit 1)
curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:9080/2 | grep 503 || (echo "Round 1 Request 2 unexpected"; exit 1)
curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:9080/3 | grep 503 || (echo "Round 1 Request 3 unexpected"; exit 1)
Expand All @@ -67,9 +67,9 @@ etcdctl --endpoints=127.0.0.1:2379 user get root
etcdctl --endpoints=127.0.0.1:2379 auth enable
sleep 3

# Restart etcd services to make sure that APISIX cannot be synchronized
# Restart etcd services to make sure that APISIX cannot be synchronized
project_compose_ci=ci/pod/docker-compose.common.yml make ci-env-stop
project_compose_ci=ci/pod/docker-compose.common.yml make ci-env-up
project_compose_ci=ci/pod/docker-compose.common.yml make ci-env-up

# Make some changes when APISIX cannot be synchronized
# Authentication ensures that only etcdctl can access etcd at this time
Expand Down Expand Up @@ -111,12 +111,12 @@ cat logs/error.log | grep "watchdir err: has no hea1lthy etcd endpoint available
## {
## kv = {
## key = "/apisix/routes/1",
## ...
## ...
## }
#### }, {
## kv = {
## key = "/apisix/routes/2",
## ...
## ...
## }
## },
## ...
Expand Down

0 comments on commit c2e7829

Please sign in to comment.