From af1589f7c9db28ecb811d43ad4fabb8d3289ac8d Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 27 Aug 2025 14:17:31 -0700 Subject: [PATCH] address comments --- test/s3/iam/Makefile | 2 +- test/s3/iam/Makefile.docker | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/test/s3/iam/Makefile b/test/s3/iam/Makefile index 0acf7184a..63b7c92d2 100644 --- a/test/s3/iam/Makefile +++ b/test/s3/iam/Makefile @@ -87,7 +87,7 @@ start-services: ## Start SeaweedFS services for testing @$(WEED_BINARY) -v=3 s3 -port=$(S3_PORT) \ -filer=localhost:$(FILER_PORT) \ -config=test_config.json \ - -iam.config=$(CURDIR)/iam_config.json > weed-s3.log 2>&1 & \ + -iam.config=$(CURDIR)/iam_config.json > weed-s3.log 2>&1 & \ echo $$! > $(S3_PID_FILE) @echo "✅ All services started" diff --git a/test/s3/iam/Makefile.docker b/test/s3/iam/Makefile.docker index 4f3a66921..df7465980 100644 --- a/test/s3/iam/Makefile.docker +++ b/test/s3/iam/Makefile.docker @@ -148,9 +148,20 @@ docker-urls: ## Display all service URLs docker-wait-healthy: ## Wait for all services to be healthy @echo "⏳ Waiting for all services to be healthy..." @timeout 300 bash -c ' \ - while [ $$(docker-compose -p $(PROJECT_NAME) -f $(COMPOSE_FILE) ps | grep -c "healthy") -lt 4 ]; do \ - echo "Waiting for services to be healthy..."; \ + required_services="keycloak weed-master weed-volume weed-filer weed-s3"; \ + while true; do \ + all_healthy=true; \ + for service in $$required_services; do \ + if ! docker-compose -p $(PROJECT_NAME) -f $(COMPOSE_FILE) ps $$service | grep -q "healthy"; then \ + echo "Waiting for $$service to be healthy..."; \ + all_healthy=false; \ + break; \ + fi; \ + done; \ + if [ "$$all_healthy" = "true" ]; then \ + break; \ + fi; \ sleep 5; \ done \ ' - @echo "✅ All services are healthy" + @echo "✅ All required services are healthy"