Aias00 commented on code in PR #7151:
URL: https://github.com/apache/shenyu/pull/7151#discussion_r4059868034


##########
shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-postgres-compose.sh:
##########
@@ -16,25 +16,26 @@
 # limitations under the License.
 #
 
+set -euo pipefail
+
 # init kubernetes for h2
 SHENYU_TESTCASE_DIR=$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")
 bash "${SHENYU_TESTCASE_DIR}"/k8s/script/storage/storage_init_postgres.sh
 curPath=$(readlink -f "$(dirname "$0")")
 PRGDIR=$(dirname "$curPath")
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-postgres.yml up -d 
--quiet-pull
-sleep 30s
+COMPOSE_FILE="$SHENYU_TESTCASE_DIR/compose/storage/shenyu-storage-postgres.yml"
 
-# execute healthcheck.sh
-chmod +x "${curPath}"/healthcheck.sh
-sh "${curPath}"/healthcheck.sh h2 http://localhost:31095/actuator/health 
http://localhost:31195/actuator/health
+# Start services and wait for their healthchecks.
+docker network create -d bridge shenyu || true
+trap 'docker compose -f "$COMPOSE_FILE" down || true' EXIT
+docker compose -f "$COMPOSE_FILE" up -d --quiet-pull --wait
 ## run e2e-test
-sleep 60s
 
 ./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-case/shenyu-e2e-case-storage 
-am test

Review Comment:
   Blocking: with `set -euo pipefail`, this line aborts the script on failure, 
so the log dumps below (lines 36-41) become unreachable.
   
   Those two blocks are the only reason they exist - this PR's own CI run 
`e2e-storage (shenyu-e2e-case-storage, e2e-postgres-compose)` aborted here and 
no admin/bootstrap logs were printed to the job output. Previously the script 
carried on and still emitted them.
   
   Suggestion: keep fail-fast behaviour but always dump the logs first, e.g.
   
   if ! ./mvnw -B -f ./shenyu-e2e/pom.xml -pl 
shenyu-e2e-case/shenyu-e2e-case-storage -am test; then
     docker compose -f "$COMPOSE_FILE" logs shenyu-admin || true
     docker compose -f "$COMPOSE_FILE" logs shenyu-bootstrap || true
     exit 1
   fi



-- 
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