Skip to content

Commit b78e9b5

Browse files
committed
Introducing healthcheck to reduce latency issues with different availabilities of wordpress
1 parent f48a11f commit b78e9b5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

energy-tests/compose.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ services:
1414
- MYSQL_PASSWORD=wordpress
1515
expose:
1616
- 3306
17+
healthcheck:
18+
test: [
19+
"CMD", "bash", "-c", "mysqladmin ping -h localhost -u wordpress -pwordpress | grep \"mysqld is alive\""
20+
]
21+
interval: "1h" # effectively turns repeated healthchecks during runtime off
22+
start_period: "60s"
23+
start_interval: "1s"
24+
1725
gcb-wordpress-apache:
1826
build:
1927
context: .
@@ -31,5 +39,6 @@ services:
3139
- WORDPRESS_DB_PASSWORD=wordpress
3240
- WORDPRESS_DB_NAME=wordpress
3341
depends_on:
34-
- gcb-wordpress-mariadb
42+
gcb-wordpress-mariadb:
43+
condition: service_healthy
3544

energy-tests/usage_scenario.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ services:
2929
- cp /tmp/repo/energy-tests/puppeteer-flow.js /var/www/puppeteer-flow.js
3030
networks:
3131
- gcb-wordpress-mariadb-network
32+
depends_on:
33+
gcb-wordpress-mariadb:
34+
condition: service_healthy
3235

3336
flow:
3437
- name: Check Website

0 commit comments

Comments
 (0)