小编BPa*_*ini的帖子

Gradle 中的 Kafka 集成测试遇到 GitHub Actions

我们一直在将我们公司的应用程序从 CircleCI 迁移到 GitHub Actions,但我们遇到了一个奇怪的情况。

项目代码没有任何变化,但我们的 kafka 集成测试在 GH Actions 机器上开始失败。在 CircleCI 和本地(MacOS 和 Fedora Linux 机器)中一切正常。

CircleCI 和 GH Actions 机器都运行 Ubuntu(测试版本为 18.04 和 20.04)。MacOS 未在 GH Actions 中进行测试,因为它没有 Docker。

以下是构建和集成测试使用的docker-compose和文件:workflow

  • docker-compose.yml
version: '2.1'

services:
  postgres:
    container_name: listings-postgres
    image: postgres:10-alpine
    mem_limit: 500m
    networks:
      - listings-stack
    ports:
      - "5432:5432"
    environment:
      POSTGRES_DB: listings
      POSTGRES_PASSWORD: listings
      POSTGRES_USER: listings
      PGUSER: listings
    healthcheck:
      test: ["CMD", "pg_isready"]
      interval: 1s
      timeout: 3s
      retries: 30

  listings-zookeeper:
    container_name: listings-zookeeper
    image: confluentinc/cp-zookeeper:6.2.0
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: …
Run Code Online (Sandbox Code Playgroud)

apache-kafka docker docker-compose github-actions

5
推荐指数
1
解决办法
755
查看次数