Set a timeout for Redis cluster operations and shut down the cluster as part of service shutdown

This commit is contained in:
Jon Chambers
2020-06-07 18:27:57 -04:00
committed by GitHub
parent 47ece983d2
commit ec858b2d4c
5 changed files with 45 additions and 10 deletions

View File

@@ -9,6 +9,8 @@ import org.junit.Before;
import org.junit.Test;
import org.whispersystems.textsecuregcm.configuration.CircuitBreakerConfiguration;
import java.time.Duration;
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
@@ -36,7 +38,7 @@ public class FaultTolerantRedisClusterTest {
breakerConfiguration.setRingBufferSizeInClosedState(1);
breakerConfiguration.setWaitDurationInOpenStateInSeconds(Integer.MAX_VALUE);
faultTolerantCluster = new FaultTolerantRedisCluster("test", clusterClient, breakerConfiguration);
faultTolerantCluster = new FaultTolerantRedisCluster("test", clusterClient, Duration.ofSeconds(2), breakerConfiguration);
}
@Test