Test case:
@Test
public void testExecInContainer() throws InterruptedException, IOException {
try (GenericContainer<?> c = new GenericContainer<>(DockerImageName.parse("redis:3.0.2"))) {
c.start();
Container.ExecResult r = c.execInContainer("/bin/bash", "-c", "sleep 600");
}
}
After 3 minutes, I've got this exception (tested with testcontainers 1.16.0):
java.lang.NullPointerException
at org.testcontainers.containers.ExecInContainerPattern.execInContainer(ExecInContainerPattern.java:85)
at org.testcontainers.containers.ContainerState.execInContainer(ContainerState.java:235)
at org.testcontainers.containers.ContainerState.execInContainer(ContainerState.java:226)
Note: I'm using DOCKER_HOST to execute on a Linux machine.
My real problem is: how do I execute a command which runs a long time? there seems to be an underlying socket timeout in docker-java, is it possible to increase this timeout?
Test case:
After 3 minutes, I've got this exception (tested with testcontainers 1.16.0):
Note: I'm using DOCKER_HOST to execute on a Linux machine.
My real problem is: how do I execute a command which runs a long time? there seems to be an underlying socket timeout in docker-java, is it possible to increase this timeout?