[Bug]: After Podman 5.x to 6.x our tests started failing when running more then one

Đang mở
#12,112 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
15/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, java
Lĩnh vực
infrastructure, testing

Hướng nghiên cứu

Start with the generated testcontainers.properties, which selects NpipeSocketClientProviderStrategy on Windows, and compare it with the DOCKER_HOST unix socket set on each MSSQLServerContainer in the reporter's base class. The failure is a NoHttpResponseException from localhost:2375 when a second container starts, so trace how the client strategy is chosen. Done means several MSSQLServer containers start in one run against Podman 6.1.4 on Windows.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

type/bug
Module

MSSQLServer

Testcontainers version

2.0.5

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host Arch

x86-64

Docker version
Client:       Podman Engine
Version:      6.1.4
API Version:  6.1.4
Go Version:   go1.26.8
Git Commit:   464c15fec06f0074c916f9eff87c4806869c2833
Built:        Mon Oct 12 22:55:21 2026
OS/Arch:      windows/amd64

Server:       Podman Engine
Version:      6.1.4
API Version:  6.1.4
Go Version:   go1.26.9-X:nodwarf5
Git Commit:   464c15fec06f0074c916f9eff87c4806869c2833
Built:        Mon Oct 12 02:00:00 2026
OS/Arch:      linux/amd64
What happened?

We made following base class

@SpringBootTest
@Testcontainers
@TestPropertySource(properties = {"spring.config.location=classpath:application-testcontainer.yaml"})
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
public abstract class AbstractTestcontainerTest {

    @Container
    private static final MSSQLServerContainer levoContainer = new MSSQLServerContainer(
            DockerImageName.parse("mcr.microsoft.com/mssql/server:2022-latest")
    ).withEnv("DOCKER_HOST", "unix:///run/podman/podman.sock");

    @Container
    private static final MSSQLServerContainer transferContainer = new MSSQLServerContainer(
            DockerImageName.parse("mcr.microsoft.com/mssql/server:2022-latest")
    ).withEnv("DOCKER_HOST", "unix:///run/podman/podman.sock");

    @Container
    private static final MSSQLServerContainer appContainer = new MSSQLServerContainer(
            DockerImageName.parse("mcr.microsoft.com/mssql/server:2022-latest")
    ).withEnv("DOCKER_HOST", "unix:///run/podman/podman.sock");

    @DynamicPropertySource
    static void setProperties(DynamicPropertyRegistry registry) {
        registry.add("levo.jdbc", levoContainer::getJdbcUrl);
        registry.add("transfer.jdbc", transferContainer::getJdbcUrl);
        registry.add("app.jdbc", appContainer::getJdbcUrl);
    }
}

Our tests extends this and before in podman 5 all these tests where working normally. After the upgrade to podman 6 if we have more then one enabled the second one always fails

16:20:39.476 [main] INFO  o.s.t.c.s.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [be.delijn.leerlingenvervoerbatch.application.jobs.facturatie.FacturatieMaandCreatieIntegrationTestDb]: FacturatieMaandCreatieIntegrationTestDb does not declare any static, non-private, non-final, nested classes annotated with @Configuration. 
16:20:39.478 [main] INFO  o.s.b.t.c.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration be.delijn.leerlingenvervoerbatch.application.LeerlingenvervoerBatchApplication for test class be.delijn.leerlingenvervoerbatch.application.jobs.facturatie.FacturatieMaandCreatieIntegrationTestDb 
16:20:39.479 [main] INFO  o.s.t.c.s.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [be.delijn.leerlingenvervoerbatch.application.jobs.facturatie.FacturatieMaandCreatieIntegrationTestDb]: FacturatieMaandCreatieIntegrationTestDb does not declare any static, non-private, non-final, nested classes annotated with @Configuration. 
16:20:39.480 [main] INFO  o.s.t.c.s.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [be.delijn.leerlingenvervoerbatch.application.AbstractTestcontainerTest]: AbstractTestcontainerTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration. 
16:20:39.481 [main] INFO  o.s.b.t.c.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration be.delijn.leerlingenvervoerbatch.application.LeerlingenvervoerBatchApplication for test class be.delijn.leerlingenvervoerbatch.application.jobs.facturatie.FacturatieMaandCreatieIntegrationTestDb 
16:20:39.483 [main] INFO  t.m.m.com/mssql/server:2022-latest - Creating container for image: mcr.microsoft.com/mssql/server:2022-latest 
16:20:39.485 [main] ERROR t.m.m.com/mssql/server:2022-latest - Could not start container 
java.lang.RuntimeException: com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.NoHttpResponseException: localhost:2375 failed to respond
	at com.github.dockerjava.zerodep.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:193)
	at com.github.dockerjava.zerodep.ZerodepDockerHttpClient.execute(ZerodepDockerHttpClient.java:8)
	at org.testcontainers.dockerclient.HeadersAddingDockerHttpClient.execute(HeadersAddingDockerHttpClient.java:23)
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.post(DefaultInvocationBuilder.java:124)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:37)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:13)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:608)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:425)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.start(TestcontainersExtension.java:276)
	at org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.access$200(TestcontainersExtension.java:263)
	at org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$startContainers$4(TestcontainersExtension.java:83)
Caused by: com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.NoHttpResponseException: localhost:2375 failed to respond

AI isn't able to help me further one bit and I'm running out of ideas

this is my testcontainers.properties (always generated by the unit test each time I run it)

#Modified by Testcontainers
#Thu Oct 15 14:54:14 CEST 2026
docker.client.strategy=org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy

any help or direction would be wildly appreciated cause atm we are disabling our tests which is a real issue for the project in the long term

Relevant log output

Additional Information

No response

Ngôn ngữ chính
Java
Star
8.8k
Fork
2k
Merge trung bình
5 ngày 21 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của testcontainers/testcontainers-java

Tất cả issue của testcontainers/testcontainers-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.