diff --git a/.requirements b/.requirements index 9e96f5679438..f5bafe3157f5 100644 --- a/.requirements +++ b/.requirements @@ -17,5 +17,5 @@ APISIX_PACKAGE_NAME=apisix -APISIX_RUNTIME=1.3.2 +APISIX_RUNTIME=1.3.3 APISIX_DASHBOARD_COMMIT=39be363cdbc5395d3163572c532be95f3dbad03a diff --git a/t/cli/test_ci_only.sh b/t/cli/test_ci_only.sh index d7d9f5bd1bbc..30e73b2083bb 100755 --- a/t/cli/test_ci_only.sh +++ b/t/cli/test_ci_only.sh @@ -49,7 +49,7 @@ git checkout conf/config.yaml mkdir /root/apisix -cp -r ./* /root/apisix +cp -R ./* /root/apisix cd /root/apisix make init diff --git a/t/cli/test_load_full_data_init_worker.sh b/t/cli/test_load_full_data_init_worker.sh index 35e7fe2ab045..5c4599623c29 100755 --- a/t/cli/test_load_full_data_init_worker.sh +++ b/t/cli/test_load_full_data_init_worker.sh @@ -19,25 +19,56 @@ . ./t/cli/common.sh +rm logs/error.log || true + git checkout conf/config.yaml echo ' apisix: worker_startup_time_threshold: 3 +nginx_config: + worker_processes: 1 + http_configuration_snippet: | + server { + listen 1980; + location /hello { + return 200 "hello world"; + } + } ' > conf/config.yaml make run sleep 5 +admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed 's/"//g') +curl -k -i http://127.0.0.1:9180/apisix/admin/routes/1 -H "X-API-KEY: $admin_key" -X PUT -d ' +{ + "uri": "/hello", + "upstream": { + "nodes": { + "127.0.0.1:1980": 1 + }, + "scheme": "http", + "type": "roundrobin" + } +}' + +sleep 1 + +code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/hello) +if [ ! $code -eq 200 ]; then + echo "failed: request failed, http status $code" + exit 1 +fi + MASTER_PID=$(cat logs/nginx.pid) -worker_pids=$(pgrep -P "$MASTER_PID" -f "nginx: worker process" || true) +worker_pid=$(pgrep -P "$MASTER_PID" -f "nginx: worker process" || true) -if [ -n "$worker_pids" ]; then - pid=$(echo "$worker_pids" | shuf -n 1) - echo "killing worker $pid (master $MASTER_PID)" - kill "$pid" +if [ -n "$worker_pid" ]; then + echo "killing worker $worker_pid (master $MASTER_PID)" + kill "$worker_pid" else echo "failed: no worker process found for master $MASTER_PID" exit 1 @@ -50,6 +81,17 @@ if ! grep 'master process has been running for a long time, reloading the full c exit 1 fi +if grep 'API disabled in the context of init_worker_by_lua' logs/error.log; then + echo "failed: cannot access etcd in init_worker phase" + exit 1 +fi + +code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/hello) +if [ ! $code -eq 200 ]; then + echo "failed: request failed for new worker, http status $code" + exit 1 +fi + echo "passed: load full configuration for new worker" make stop