0

我有一些测试容器正在运行我的 junit 集成测试(Spring Boot,Junit 5)

public static PostgreSQLContainer<?> postgresContainer= new PostgreSQLContainer<>("postgres:13")
            .withDatabaseName("test")
            .withUsername("postgres")
            .withPassword("testIntegration")
            .withExposedPorts(5432)
            .withInitScript("test.sql")

一个用于另一个 postgrs 数据库,一个用于 ActiveMQ 通用

    public static GenericContainer<?> aMQContainer= new GenericContainer<>("rmohr/activemq")
            .withExposedPorts(61616)
            .withEnv("DISABLE_SECURITY", "true")
            .withEnv("BROKER_CONFIG_GLOBAL_MAX_SIZE", "50000")
            .withEnv("BROKER_CONFIG_MAX_SIZE_BYTES", "50000")
            .withEnv("BROKER_CONFIG_MAX_DISK_USAGE", "100");
        postgresContainer.start();
        postgresContainer2.start();
        aMQContainer.start();

本地一切正常,但是当我在 Linux 环境(Raspberry Pi 4 4GB Model B)中设置的 Jenkins 中运行测试时,我收到以下错误:

    Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed
    Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
    Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
    Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log  output   matching .*database systemt is ready to accept connections

我尝试添加等待条件,或 withStartupTimeoutSeconds(240) 但无济于事。

有类似问题的人吗?

4

0 回答 0