Skip to content

Commit 2e9595e

Browse files
committed
Improve waiting strategy for SMB test container
1 parent af4e632 commit 2e9595e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

x-pack/test/smb-fixture/src/main/java/org/elasticsearch/test/fixtures/smb/SmbTestContainer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import org.elasticsearch.test.fixtures.testcontainers.DockerEnvironmentAwareTestContainer;
1313
import org.testcontainers.containers.wait.strategy.Wait;
14+
import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
1415
import org.testcontainers.images.builder.ImageFromDockerfile;
1516

1617
public final class SmbTestContainer extends DockerEnvironmentAwareTestContainer {
@@ -44,7 +45,11 @@ public SmbTestContainer() {
4445
addExposedPort(AD_LDAP_PORT);
4546
addExposedPort(AD_LDAP_GC_PORT);
4647

47-
setWaitStrategy(Wait.forLogMessage(".*Samba started.*", 1));
48+
setWaitStrategy(
49+
new WaitAllStrategy()
50+
.withStrategy(Wait.forLogMessage(".*Samba started.*", 1))
51+
.withStrategy(Wait.forListeningPort())
52+
);
4853

4954
getCreateContainerCmdModifiers().add(createContainerCmd -> {
5055
createContainerCmd.getHostConfig().withCapAdd(Capability.SYS_ADMIN);

0 commit comments

Comments
 (0)