简体   繁体   English

testcontainers 无法在 mac m1 上以 maven 启动

[英]testcontainers fails to start with maven on mac m1

I am trying to create testcontainers and they are failing with below errors我正在尝试创建测试容器,但它们因以下错误而失败

Inside the container容器内

[2022-08-16 07:22:52,694] INFO 172.29.0.1 - - [16/Aug/2022:07:22:52 +0000] "GET /info HTTP/1.1" 404 49  21 (io.confluent.rest-utils.requests)
[2022-08-16 07:22:53,708] ERROR Request Failed with exception  (io.confluent.rest.exceptions.DebuggableExceptionMapper)
javax.ws.rs.NotFoundException: HTTP 404 Not Found

On the logs在日志上

12:41:07.851 [main] ERROR 🐳 [confluentinc/cp-schema-registry:5.5.0] - Could not start container
org.testcontainers.containers.ContainerLaunchException: Timed out waiting for container port to open (localhost ports: [57338] should be listening)
    at org.testcontainers.containers.wait.strategy.HostPortWaitStrategy.waitUntilReady(HostPortWaitStrategy.java:90)

This is my implementation这是我的实现

public class SchemaRegistryContainer extends GenericContainer<SchemaRegistryContainer> {
  private static final int SCHEMA_PORT = 8081;

  public SchemaRegistryContainer(String version) {
    super("confluentinc/cp-schema-registry:" + version);
    withExposedPorts(8081);
    waitStrategy = Wait
        .forHttp("/info")
        .forStatusCode(200)
        .withStartupTimeout(Duration.ofMinutes(5));
  }
}

Here is environment details这是环境细节

OS: MacBook Air (M1, 2020) Version 12.1 Apple M1操作系统: MacBook Air (M1, 2020) Version 12.1 Apple M1

Java version: openjdk version "13.0.2" 2020-01-14 Java版本: openjdk version "13.0.2" 2020-01-14

<testcontainers.version>1.17.2</testcontainers.version>

<testcontainers.junit-jupiter.version>1.17.2</testcontainers.junit-jupiter.version>

Please check if schema registry service from confluent platform has /info endpoint.请检查confluent platform的模式注册服务是否具有/info端点。

Reference: https://docs.confluent.io/platform/current/schema-registry/develop/api.html参考: https://docs.confluent.io/platform/current/schema-registry/develop/api.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM