Skip to content

Commit

Permalink
fix(db): docker test entrypoint threshold timeout failed
Browse files Browse the repository at this point in the history
  • Loading branch information
AHPanna authored and wdavidw committed May 13, 2024
1 parent 3e0acf7 commit 427fa10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
17 changes: 6 additions & 11 deletions packages/db/env/mysql/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ services:
build: .
container_name: nikita_db_mysql_nodejs
depends_on:
- mysql
# Not fully working for now, waiting is implemented inside entrypoint.sh
# mysql:
# condition: service_healthy
mysql:
condition: service_healthy
environment:
NIKITA_TEST_MODULE: /nikita/packages/db/env/mysql/test.coffee
image: nikita_db_mysql_nodejs
Expand All @@ -17,17 +15,14 @@ services:
- ../../../../:/nikita
mysql:
container_name: nikita_db_mysql_db
# To avoid an error in the latest versions: ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded
command: --default-authentication-plugin=caching_sha2_password
environment:
MYSQL_ROOT_PASSWORD: rootme
expose:
- "3306"
# healthcheck:
# test: "bash -c 'echo > /dev/tcp/mysql/3306'"
# interval: 1s
# timeout: 1s
# retries: 20
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "mysql"]
timeout: 20s
retries: 10
image: mysql:latest
# logging:
# driver: none
Expand Down
6 changes: 0 additions & 6 deletions packages/db/env/mysql/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
. ~/.bashrc
# Start ssh daemon
sudo /usr/sbin/sshd
# Wait until MySQL is ready
i=0; until echo > /dev/tcp/mysql/3306; do
[[ i -eq 10 ]] && >&2 echo 'Docker not yet started after 10s' && exit 1
((i++))
sleep 1
done
# Test execution
if test -t 0; then
# We have TTY, so probably an interactive container...
Expand Down

0 comments on commit 427fa10

Please sign in to comment.