diff --git a/test/docker-compose-kafka.yml b/test/docker-compose-kafka.yml index a8c0763..531f9a7 100644 --- a/test/docker-compose-kafka.yml +++ b/test/docker-compose-kafka.yml @@ -1,32 +1,14 @@ version: '3.4' services: - zookeeper: - image: confluentinc/cp-zookeeper:7.0.0 - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - ZOOKEEPER_TICK_TIME: 2000 - kafka: - image: confluentinc/cp-kafka:7.0.0 - volumes: - - ./kafka-test.sh:/kafka-test.sh + image: apache/kafka-native:3.8.0 healthcheck: - test: /kafka-test.sh - # health checks happen every 10s, failures in the first 30s are not counted toward the maximum number of retries, - # after 3 failed health checks the service is marked as unhealthy - interval: 10s + test: ["CMD", "nc", "-z", "localhost", "9092"] + # health checks happen every 2s, failures in the first 30s are not counted toward the maximum number of retries, + # after 5 failed health checks the service is marked as unhealthy + interval: 2s timeout: 10s - retries: 3 + retries: 5 start_period: 30s - depends_on: - - zookeeper ports: - "9092:9092" - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" diff --git a/test/docker-compose-redpanda.yml b/test/docker-compose-redpanda.yml index 7db2887..e14b2e6 100644 --- a/test/docker-compose-redpanda.yml +++ b/test/docker-compose-redpanda.yml @@ -1,9 +1,4 @@ version: '3.7' -networks: - redpanda_network: - driver: bridge -volumes: - redpanda: null services: redpanda: image: docker.redpanda.com/redpandadata/redpanda:v23.1.4 @@ -18,7 +13,3 @@ services: ports: - 9092:9092 - 29092:29092 - volumes: - - redpanda:/var/lib/redpanda/data - networks: - - redpanda_network diff --git a/test/kafka-test.sh b/test/kafka-test.sh deleted file mode 100755 index 11b4af7..0000000 --- a/test/kafka-test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# This forces Kafka to set up the __consumer_offsets topic, which is done on first read. -# Without this, certain tests timeout, since the first read takes a lot of time. -echo "test-message" | kafka-console-producer --bootstrap-server localhost:9092 --topic test-topic -kafka-console-consumer --bootstrap-server localhost:9092 --topic test-topic --max-messages 1 --from-beginning