|
46 | 46 | import org.msgpack.value.ValueFactory; |
47 | 47 | import org.slf4j.LoggerFactory; |
48 | 48 | import org.testcontainers.containers.ClusterContainer; |
| 49 | +import org.testcontainers.containers.Network; |
49 | 50 | import org.testcontainers.containers.TarantoolCartridgeContainer; |
50 | 51 | import org.testcontainers.containers.VshardClusterContainer; |
51 | 52 | import org.testcontainers.containers.output.Slf4jLogConsumer; |
| 53 | +import org.testcontainers.containers.wait.strategy.HostPortWaitStrategy; |
52 | 54 | import org.testcontainers.junit.jupiter.Testcontainers; |
53 | 55 |
|
54 | 56 | import static io.tarantool.client.crud.ConditionOperator.EQ; |
@@ -104,6 +106,7 @@ public class TarantoolCrudClientTest extends BaseTest { |
104 | 106 | private static TarantoolCartridgeContainer cartridgeContainer; |
105 | 107 | private static VshardClusterContainer vshardClusterContainer; |
106 | 108 | private static ClusterContainer clusterContainer; |
| 109 | + private static final Network NETWORK = Network.newNetwork(); |
107 | 110 | public static final String ROUTER_1 = "ROUTER_1"; |
108 | 111 | public static final String ROUTER_2 = "ROUTER_2"; |
109 | 112 | private static TarantoolCrudClient client; |
@@ -133,16 +136,19 @@ public static void setUp() throws Exception { |
133 | 136 | if (!isCartridgeAvailable()) { |
134 | 137 | vshardClusterContainer = |
135 | 138 | new VshardClusterContainer( |
136 | | - "vshard_cluster/Dockerfile", |
137 | | - dockerRegistry + "vshard-cluster-java", |
138 | | - "vshard_cluster/instances.yaml", |
139 | | - "vshard_cluster/config.yaml", |
140 | | - "tarantool/tarantool"); |
| 139 | + "vshard_cluster/Dockerfile", |
| 140 | + dockerRegistry + "vshard-cluster-java", |
| 141 | + "vshard_cluster/instances.yaml", |
| 142 | + "vshard_cluster/config.yaml", |
| 143 | + "tarantool/tarantool") |
| 144 | + .withNetwork(NETWORK) |
| 145 | + .withWaitingStrategy(new HostPortWaitStrategy().forPorts(3301)); |
141 | 146 |
|
142 | 147 | if (!vshardClusterContainer.isRunning()) { |
143 | 148 | vshardClusterContainer |
144 | 149 | .withCreateContainerCmdModifier(cmd -> cmd.withUser("root")) |
145 | | - .withPrivilegedMode(true); |
| 150 | + .withPrivilegedMode(true) |
| 151 | + .withStartupTimeout(Duration.ofMinutes(5)); |
146 | 152 | vshardClusterContainer.start(); |
147 | 153 | } |
148 | 154 | clusterContainer = vshardClusterContainer; |
|
0 commit comments