Skip to content

Commit 0da7fca

Browse files
authored
Fix apparent race condition in test, observed in docker-machine on Mac (#459)
Fix apparent race condition in test, observed in docker-machine on Mac Startup success detection appeared to be seeing container as having exited already For the purposes of this test, all we need is a positive `isRunning` state, so a container long running command (`top`) is sufficient to achieve this
1 parent 5ccb305 commit 0da7fca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/test/java/org/testcontainers/junit/GenericContainerRuleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static void setupContent() throws FileNotFoundException {
147147

148148
@Test
149149
public void testIsRunning() {
150-
try (GenericContainer container = new GenericContainer()) {
150+
try (GenericContainer container = new GenericContainer().withCommand("top")) {
151151
assertFalse("Container is not started and not running", container.isRunning());
152152
container.start();
153153
assertTrue("Container is started and running", container.isRunning());

0 commit comments

Comments
 (0)