首页 > 解决方案 > 用于测试容器的通用测试容器抛出 409 说容器未运行

问题描述

这是我的代码片段

override val container = GenericContainer("memsql/cluster-in-a-box:latest")
container.start()
container.underlyingUnsafeContainer.setWaitStrategy(Wait.forHealthcheck())
container.underlyingUnsafeContainer.start()
container.underlyingUnsafeContainer.execInContainer("ls", "-al", "/") //throw 409 here
container.stop()

我在控制台中看到说容器已经启动。不知道为什么我会得到 409。

控制台日志:Container memsql/cluster-in-a-box:latest started in PT0.406374S

标签: testcontainers

解决方案


推荐阅读