Copilot commented on code in PR #6363:
URL: https://github.com/apache/shenyu/pull/6363#discussion_r3371274412


##########
shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/compose/script/e2e-http-sync-compose.sh:
##########
@@ -16,47 +16,78 @@
 # limitations under the License.
 #
 
+set -euo pipefail
+
 # init kubernetes for mysql
 SHENYU_TESTCASE_DIR=$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")
 bash "${SHENYU_TESTCASE_DIR}"/k8s/script/storage/storage_init_mysql.sh
 
 # init register center
 CUR_PATH=$(readlink -f "$(dirname "$0")")
 PRGDIR=$(dirname "$CUR_PATH")
+HEALTHCHECK_SCRIPT="${SHENYU_TESTCASE_DIR}/k8s/script/healthcheck.sh"
+
+log_compose() {
+  local sync=$1
+  local 
sync_compose_file="${SHENYU_TESTCASE_DIR}/compose/sync/shenyu-sync-${sync}.yml"
+
+  echo "------------------"
+  echo "shenyu-admin log:"
+  echo "------------------"
+  docker compose -f "$sync_compose_file" logs shenyu-admin || true
+  echo "shenyu-bootstrap log:"
+  echo "------------------"
+  docker compose -f "$sync_compose_file" logs shenyu-bootstrap || true
+  echo "shenyu-examples-http log:"
+  echo "------------------"
+  docker compose -f "${PRGDIR}"/shenyu-examples-http-compose.yml logs 
shenyu-examples-http || true
+}
+
+start_sync_compose() {
+  local sync=$1
+  local 
sync_compose_file="${SHENYU_TESTCASE_DIR}/compose/sync/shenyu-sync-${sync}.yml"
+
+  if ! docker compose -f "$sync_compose_file" up -d --quiet-pull; then
+    echo "docker compose returned before all services became healthy; 
continuing with explicit readiness checks"
+    docker compose -f "$sync_compose_file" ps || true
+  fi
+
+  sh "$HEALTHCHECK_SCRIPT" http://localhost:31095/actuator/health
+  docker compose -f "$sync_compose_file" up -d --quiet-pull shenyu-bootstrap
+  sh "$HEALTHCHECK_SCRIPT" http://localhost:31195/actuator/health
+}
+
+start_examples() {
+  docker compose -f "${PRGDIR}"/shenyu-examples-http-compose.yml up -d 
--quiet-pull
+  sh "$HEALTHCHECK_SCRIPT" http://localhost:31189/actuator/health
+}
+
 # init shenyu sync
 SYNC_ARRAY=("websocket" "http" "zookeeper")
 #SYNC_ARRAY=("websocket" "nacos")
 #MIDDLEWARE_SYNC_ARRAY=("zookeeper" "etcd" "nacos")
 
-docker network create -d bridge shenyu
+docker network create -d bridge shenyu || true

Review Comment:
   `docker network create ... || true` will mask all failures (e.g., Docker 
daemon unavailable), which can lead to harder-to-diagnose follow-on errors. 
Since `set -euo pipefail` is enabled, it’s safer to only skip creation when the 
network already exists.



##########
progress.md:
##########
@@ -0,0 +1,14 @@
+E2E compose readiness fix progress
+
+Done:
+- Created isolated worktree at .worktrees/fix-e2e-compose-readiness on branch 
codex/fix-e2e-compose-readiness.
+- Confirmed the CI failure path: shenyu-admin briefly failed to connect to 
MySQL, docker compose returned with shenyu-admin unhealthy, shenyu-bootstrap 
never became available on localhost:31195, and tests continued until Maven 
reported gateway unavailable.

Review Comment:
   This file reads like personal/temporary development notes (e.g., local 
worktree path, ad-hoc progress tracking) rather than project documentation. 
Keeping it in the repository will add noise and likely become stale; consider 
removing it from the PR and moving the notes into the PR description or an 
issue comment instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to