Skip to content

Commit c3c1684

Browse files
authored
test: add health check for bvitess (#8658)
This replaces the health check inside `test/entrypoint.sh`. Advantage: if bvitess exits outright during health checking, `docker compose` can report that more clearly than `test/entrypoint.sh` can, and can also terminte the run of the `boulder` container early, rather than waiting for the health check to timeout. We can apply the same transformation to the other health checks if we like this one.
1 parent e7eb105 commit c3c1684

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

docker-compose.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,22 @@ services:
5151
- 4001:4001 # ACMEv2
5252
- 4003:4003 # SFE
5353
depends_on:
54-
- bmariadb
55-
- bproxysql
56-
- bvitess
57-
- bredis_1
58-
- bredis_2
59-
- bconsul
60-
- bjaeger
61-
- bpkimetal
54+
bmariadb:
55+
condition: service_started
56+
bproxysql:
57+
condition: service_started
58+
bvitess:
59+
condition: service_healthy
60+
bredis_1:
61+
condition: service_started
62+
bredis_2:
63+
condition: service_started
64+
bconsul:
65+
condition: service_started
66+
bjaeger:
67+
condition: service_started
68+
bpkimetal:
69+
condition: service_started
6270
entrypoint: test/entrypoint.sh
6371
working_dir: &boulder_working_dir /boulder
6472

@@ -154,6 +162,20 @@ services:
154162
# databases on startup.
155163
KEYSPACES: boulder_sa,incidents_sa,boulder_sa_next,incidents_sa_next
156164
NUM_SHARDS: 1,1,1,1
165+
healthcheck:
166+
# Make sure the service is up and the tables are created. Use `serials` because it happens
167+
# to be last in the SQL initialization files, so if it exists the other tables do too.
168+
# Note that the mysql command issues some queries on startup that result in this spurious
169+
# logging from bvitess:
170+
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL
171+
# server version for the right syntax to use near '$$ from dual limit 10001'
172+
test: [ "CMD", "mysql", "-h", "127.0.0.1", "-P", "33577", "-D", "boulder_sa",
173+
"-e", "SELECT 1 FROM serials"]
174+
interval: 2s
175+
timeout: 30s
176+
retries: 3
177+
start_period: 10s
178+
start_interval: 2s
157179
networks:
158180
bouldernet:
159181
aliases:

test/entrypoint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ configure_database_endpoints
4646
./test/wait-for-it.sh boulder-mariadb 3306
4747
./test/wait-for-it.sh boulder-proxysql 6033
4848

49-
# make sure we can reach vitess
50-
./test/wait-for-it.sh boulder-vitess 33577
51-
5249
# make sure we can reach pkilint
5350
./test/wait-for-it.sh bpkimetal 8080
5451

0 commit comments

Comments
 (0)