Test fix on local
This commit is contained in:
@@ -14,6 +14,11 @@ on:
|
||||
jobs:
|
||||
backend:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# Kafka advertises this host on its EXTERNAL listener. The test process runs in
|
||||
# a job container, so "localhost" (the compose default, correct for a dev box)
|
||||
# would point the client at itself after bootstrap.
|
||||
KAFKA_EXTERNAL_HOST: host.docker.internal
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -34,9 +39,11 @@ jobs:
|
||||
- name: Wait for Kafka
|
||||
run: |
|
||||
for i in $(seq 1 90); do
|
||||
# Probe the INTERNAL listener: the EXTERNAL one advertises
|
||||
# host.docker.internal, which does not resolve inside the broker container.
|
||||
if docker compose exec -T kafka \
|
||||
/opt/kafka/bin/kafka-broker-api-versions.sh \
|
||||
--bootstrap-server localhost:9092 >/dev/null 2>&1; then
|
||||
--bootstrap-server kafka:29092 >/dev/null 2>&1; then
|
||||
echo "Kafka is ready"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user