Merge pull request #1910 from mozilla-services/chore/e2e-docker-healthcheck-STOR-416

chore: add healthcheck to prevent e2e tests starting too early
This commit is contained in:
Barry Chen 2025-12-04 12:13:09 -06:00 committed by GitHub
commit 4bca93ca67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 29 additions and 5 deletions

View File

@ -12,7 +12,7 @@ services:
# the syncserver isn't actually used for the tests,
# but collisions can happen particularly in CI.
syncserver:
condition: service_started
condition: service_healthy
image: app:build
privileged: true
user: root

View File

@ -5,7 +5,7 @@ services:
mock-fxa-server:
condition: service_started
syncserver:
condition: service_started
condition: service_healthy
tokenserver-db:
condition: service_healthy
image: app:build

View File

@ -5,7 +5,7 @@ services:
mock-fxa-server:
condition: service_started
syncserver:
condition: service_started
condition: service_healthy
tokenserver-db:
condition: service_healthy
image: app:build

View File

@ -79,6 +79,12 @@ services:
SYNC_SYNCSTORAGE__DATABASE_URL: mysql://test:test@sync-db:3306/syncstorage
SYNC_TOKENSERVER__DATABASE_URL: mysql://test:test@tokenserver-db:3306/tokenserver
SYNC_TOKENSERVER__RUN_MIGRATIONS: "true"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/__heartbeat__ || exit 1"]
interval: 2s
retries: 5
start_period: 30s
timeout: 3s
volumes:
sync_db_data:

View File

@ -62,7 +62,10 @@ services:
ports:
- "8000:8000"
depends_on:
- sync-db-setup
sync-db-setup:
condition: service_started
tokenserver-db:
condition: service_healthy
environment:
SYNC_HOST: 0.0.0.0
SYNC_MASTER_SECRET: secret0
@ -70,6 +73,12 @@ services:
SYNC_SYNCSTORAGE__SPANNER_EMULATOR_HOST: sync-db:9010
SYNC_TOKENSERVER__DATABASE_URL: postgres://test:test@tokenserver-db:5432/tokenserver
SYNC_TOKENSERVER__RUN_MIGRATIONS: "true"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/__heartbeat__ || exit 1"]
interval: 2s
retries: 5
start_period: 30s
timeout: 3s
volumes:
tokenserver_db_data:

View File

@ -60,7 +60,10 @@ services:
ports:
- "8000:8000"
depends_on:
- sync-db-setup
sync-db-setup:
condition: service_started
tokenserver-db:
condition: service_healthy
environment:
SYNC_HOST: 0.0.0.0
SYNC_MASTER_SECRET: secret0
@ -68,6 +71,12 @@ services:
SYNC_SYNCSTORAGE__SPANNER_EMULATOR_HOST: sync-db:9010
SYNC_TOKENSERVER__DATABASE_URL: mysql://test:test@tokenserver-db:3306/tokenserver
SYNC_TOKENSERVER__RUN_MIGRATIONS: "true"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/__heartbeat__ || exit 1"]
interval: 2s
retries: 5
start_period: 30s
timeout: 3s
volumes:
tokenserver_db_data: