Skip to content

Commit

Permalink
fixed replicate cluster live unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Jan 11, 2021
1 parent c0ef9f5 commit c01fe32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.item.redis.RedisClusterDataStructureItemReader;
import org.springframework.batch.item.redis.support.KeyComparisonItemWriter;
import org.springframework.batch.item.redis.support.RedisClusterDatasetSizeEstimator;
import org.testcontainers.containers.FixedHostPortGenericContainer;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
Expand Down Expand Up @@ -69,7 +66,7 @@ protected String connectionArgs() {
@BeforeEach
public void setup() throws InterruptedException {
// wait enought time for all cluster nodes to start and become ready
Thread.sleep(5000);
Thread.sleep(10000);
String redisIpAddress = "0.0.0.0";
sourceURIs = IntStream.rangeClosed(7000, 7005).boxed().map(p -> RedisURI.create(redisIpAddress, p)).collect(Collectors.toList());
sourceClient = RedisClusterClient.create(sourceURIs);
Expand Down Expand Up @@ -99,7 +96,7 @@ protected String process(String command) {
public void replicateLive() throws Exception {
RedisClusterClient client = RedisClusterClient.create(sourceURIs);
StatefulRedisClusterConnection<String, String> connection = client.connect();
DataGenerator.builder().commands(connection.sync()).end(10000000).build().run();
DataGenerator.builder().commands(connection.sync()).end(10000).build().run();
ReplicateCommand command = (ReplicateCommand) command("/replicate-cluster-live.txt");
JobExecution execution = command.executeAsync();
while (!execution.isRunning()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
❯ riot-redis -h source -p 6379 --cluster replicate -h target -p 6380 --live
❯ riot-redis -h source -p 6379 --cluster replicate -h target -p 6380 --live --no-verify

0 comments on commit c01fe32

Please sign in to comment.