Skip to content

Commit 3833ce4

Browse files
aguibertbsideup
andauthored
Add more clear warning message instructing users how to enable reusable containers (#2422)
* Add more clear warning message instructing users how to enable reusable containers * Update GenericContainer.java Co-authored-by: Sergei Egorov <[email protected]>
1 parent 0b7e72f commit 3833ce4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/src/main/java/org/testcontainers/containers/GenericContainer.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import java.nio.charset.Charset;
7070
import java.nio.file.Files;
7171
import java.nio.file.Path;
72+
import java.nio.file.Paths;
7273
import java.time.Duration;
7374
import java.time.Instant;
7475
import java.util.ArrayList;
@@ -376,7 +377,12 @@ private void tryStart(Instant startedAt) {
376377
}
377378
reusable = true;
378379
} else {
379-
logger().info("Reuse was requested but the environment does not support the reuse of containers");
380+
logger().warn(
381+
"" +
382+
"Reuse was requested but the environment does not support the reuse of containers\n" +
383+
"To enable reuse of containers, you must set 'testcontainers.reuse.enable=true' in a file located at {}",
384+
Paths.get(System.getProperty("user.home"), ".testcontainers.properties")
385+
);
380386
reusable = false;
381387
}
382388
} else {

0 commit comments

Comments
 (0)