Skip to content

Commit

Permalink
test: add healthcheck for zookeeper test service so 'npm test' works …
Browse files Browse the repository at this point in the history
…outside of CI (#3928)

Running 'npm test' outside of CI will start all test services in docker
*then wait for them to all be healthy*. Without a healthcheck for zk
the 'wait_for_healthy' in test/script/run_tests.sh would never pass.
  • Loading branch information
trentm authored Mar 25, 2024
1 parent b49c460 commit 42eef29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .ci/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ services:
- nodezookeeperdata:/bitnami
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
healthcheck:
# Using 'srvr' instead of the more common 'ruok' because this bitnami
# image does not have 'ruok' on the '4lw.commands.whitelist' in zoo.cfg.
test: ["CMD-SHELL", "echo srvr | nc -w 2 localhost 2181"]
interval: 5s
timeout: 5s
retries: 5

kafka:
# https://hub.docker.com/r/bitnami/kafka/tags
Expand Down
7 changes: 7 additions & 0 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ services:
- nodezookeeperdata:/var/lib/zookeeper/data
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
healthcheck:
# Using 'srvr' instead of the more common 'ruok' because this bitnami
# image does not have 'ruok' on the '4lw.commands.whitelist' in zoo.cfg.
test: ["CMD-SHELL", "echo srvr | nc -w 2 localhost 2181"]
interval: 5s
timeout: 5s
retries: 5

kafka:
# https://hub.docker.com/r/bitnami/kafka/tags
Expand Down

0 comments on commit 42eef29

Please sign in to comment.