From ecde3e47fa67e46e042d4c9c13cc6f2277a36069 Mon Sep 17 00:00:00 2001 From: liuhy Date: Tue, 9 Jun 2026 13:43:04 +0800 Subject: [PATCH] Recover RocketMQ e2e bootstrap after delayed admin health The RocketMQ logging e2e script runs three sync modes in sequence. In the zookeeper round, Docker Compose can return before shenyu-admin has recovered from an initial unhealthy state, leaving shenyu-bootstrap created but not started. The script previously ignored both that compose failure and later healthcheck failures, so Maven reported the gateway as unavailable instead of recovering the service stack first. Constraint: CI builds the required latest Docker images before this script runs Rejected: Increase fixed sleeps only | it would hide the dependency failure without ensuring bootstrap starts Confidence: medium Scope-risk: narrow Directive: Keep bootstrap startup gated on admin health for this e2e script Tested: bash -n e2e-logging-rocketmq-compose.sh; e2e RocketMQ test-compile; RocketMQ logging plugin test-compile; docker compose config for zookeeper, RocketMQ, and HTTP example compose files; git diff --check Not-tested: Full Docker Compose e2e locally because CI-built apache/shenyu-admin:latest, apache/shenyu-bootstrap:latest, and shenyu-examples-http:latest images are not present --- .../compose/script/e2e-logging-rocketmq-compose.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-logging-rocketmq/compose/script/e2e-logging-rocketmq-compose.sh b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-logging-rocketmq/compose/script/e2e-logging-rocketmq-compose.sh index 4049b338fd61..1967c16f0d4a 100644 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-logging-rocketmq/compose/script/e2e-logging-rocketmq-compose.sh +++ b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-logging-rocketmq/compose/script/e2e-logging-rocketmq-compose.sh @@ -31,16 +31,18 @@ SYNC_ARRAY=("websocket" "http" "zookeeper") docker network create -d bridge shenyu for sync in "${SYNC_ARRAY[@]}"; do + sync_compose_file="$SHENYU_TESTCASE_DIR"/compose/sync/shenyu-sync-"${sync}".yml echo -e "------------------\n" echo "[Start ${sync} synchronous] create shenyu-admin-${sync}.yml shenyu-bootstrap-${sync}.yml " - docker compose -f "$SHENYU_TESTCASE_DIR"/compose/sync/shenyu-sync-"${sync}".yml up -d --quiet-pull + docker compose -f "${sync_compose_file}" up -d --quiet-pull || true sleep 30s - sh "$SHENYU_TESTCASE_DIR"/k8s/script/healthcheck.sh http://localhost:31095/actuator/health - sh "$SHENYU_TESTCASE_DIR"/k8s/script/healthcheck.sh http://localhost:31195/actuator/health + sh "$SHENYU_TESTCASE_DIR"/k8s/script/healthcheck.sh http://localhost:31095/actuator/health || exit 1 + docker compose -f "${sync_compose_file}" up -d shenyu-bootstrap + sh "$SHENYU_TESTCASE_DIR"/k8s/script/healthcheck.sh http://localhost:31195/actuator/health || exit 1 docker compose -f "${PRGDIR}"/shenyu-rocketmq-compose.yml up -d --quiet-pull docker compose -f "${PRGDIR}"/shenyu-examples-http-compose.yml up -d --quiet-pull sleep 30s - sh "$SHENYU_TESTCASE_DIR"/k8s/script/healthcheck.sh http://localhost:31189/actuator/health + sh "$SHENYU_TESTCASE_DIR"/k8s/script/healthcheck.sh http://localhost:31189/actuator/health || exit 1 sleep 10s docker ps -a ## run e2e-test @@ -60,7 +62,7 @@ for sync in "${SYNC_ARRAY[@]}"; do docker compose -f "${PRGDIR}"/shenyu-rocketmq-compose.yml logs exit 1 fi - docker compose -f "$SHENYU_TESTCASE_DIR"/compose/sync/shenyu-sync-"${sync}".yml down + docker compose -f "${sync_compose_file}" down docker compose -f "${PRGDIR}"/shenyu-rocketmq-compose.yml down docker compose -f "${PRGDIR}"/shenyu-examples-http-compose.yml down echo "[Remove ${sync} synchronous] delete shenyu-admin-${sync}.yml shenyu-bootstrap-${sync}.yml "