File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1616package org .springframework .data .mongodb .test .util ;
1717
1818import org .springframework .core .env .StandardEnvironment ;
19+
20+ import org .testcontainers .containers .wait .strategy .Wait ;
21+ import org .testcontainers .containers .wait .strategy .WaitAllStrategy ;
1922import org .testcontainers .mongodb .MongoDBAtlasLocalContainer ;
2023import org .testcontainers .utility .DockerImageName ;
2124
@@ -36,12 +39,18 @@ public class AtlasContainer extends MongoDBAtlasLocalContainer {
3639 public static final String ATLAS_HOST = "docker.mongodb.atlas.host" ;
3740 public static final String ATLAS_PORT = "docker.mongodb.atlas.port" ;
3841
42+ public static final WaitAllStrategy WAIT_STRATEGY = new WaitAllStrategy (
43+ WaitAllStrategy .Mode .WITH_MAXIMUM_OUTER_TIMEOUT ).withStrategy (Wait .forListeningPort ())
44+ .withStrategy (Wait .forSuccessfulCommand ("runner healthcheck" ));
45+
3946 private AtlasContainer (String dockerImageName ) {
4047 super (DockerImageName .parse (dockerImageName ));
48+ this .waitingFor (WAIT_STRATEGY );
4149 }
4250
4351 private AtlasContainer (DockerImageName dockerImageName ) {
4452 super (dockerImageName );
53+ this .waitingFor (WAIT_STRATEGY );
4554 }
4655
4756 public static AtlasContainer bestMatch () {
You can’t perform that action at this time.
0 commit comments