update riak container config

This commit is contained in:
ggmaleva 2021-09-30 18:29:28 +03:00
parent cb10a162ea
commit 214ab3240a
No known key found for this signature in database
GPG Key ID: 0E412B78565B108F

View File

@ -7,6 +7,7 @@ import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.WaitAllStrategy; import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
import java.time.Duration; import java.time.Duration;
import java.util.UUID;
public class RiakContainerExtension implements BeforeAllCallback, AfterAllCallback { public class RiakContainerExtension implements BeforeAllCallback, AfterAllCallback {
@ -17,6 +18,10 @@ public class RiakContainerExtension implements BeforeAllCallback, AfterAllCallba
riak = new GenericContainer("basho/riak-kv") riak = new GenericContainer("basho/riak-kv")
.withExposedPorts(8098, 8087) .withExposedPorts(8098, 8087)
.withPrivilegedMode(true) .withPrivilegedMode(true)
.withNetworkAliases("riak-kv-" + UUID.randomUUID())
.withEnv("CLUSTER_NAME", "riakts")
.withEnv("WAIT_FOR_ERLANG", "1000")
.withLabel("com.basho.riak.cluster.name", "riakts")
.waitingFor(new WaitAllStrategy() .waitingFor(new WaitAllStrategy()
.withStartupTimeout(Duration.ofMinutes(2))); .withStartupTimeout(Duration.ofMinutes(2)));