This is an automated email from the ASF dual-hosted git repository.

donalevans pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new fdda7db  GEODE-9506: Do not use random ephemeral port to start Redis 
servers (#6790)
fdda7db is described below

commit fdda7dbde334311cc1c6ab7a78e28587c96f327d
Author: Donal Evans <[email protected]>
AuthorDate: Tue Aug 24 14:55:26 2021 -0700

    GEODE-9506: Do not use random ephemeral port to start Redis servers (#6790)
    
    Authored-by: Donal Evans <[email protected]>
---
 .../geode/redis/session/SessionsAndCrashesDUnitTest.java  | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git 
a/geode-apis-compatible-with-redis/src/distributedTest/java/org/apache/geode/redis/session/SessionsAndCrashesDUnitTest.java
 
b/geode-apis-compatible-with-redis/src/distributedTest/java/org/apache/geode/redis/session/SessionsAndCrashesDUnitTest.java
index 4bc044a..7f6b58c 100644
--- 
a/geode-apis-compatible-with-redis/src/distributedTest/java/org/apache/geode/redis/session/SessionsAndCrashesDUnitTest.java
+++ 
b/geode-apis-compatible-with-redis/src/distributedTest/java/org/apache/geode/redis/session/SessionsAndCrashesDUnitTest.java
@@ -62,11 +62,9 @@ public class SessionsAndCrashesDUnitTest {
   private static final int NUM_SESSIONS = 100;
   private static final List<String> sessionIds = new ArrayList<>(NUM_SESSIONS);
   private static MemberVM locator;
-  private static MemberVM server1;
   private static MemberVM server2;
   private static MemberVM server3;
   private static int[] redisPorts;
-  private static JedisCluster jedis;
 
   private SessionRepository<Session> sessionRepository;
   private ConfigurableApplicationContext springContext;
@@ -75,16 +73,13 @@ public class SessionsAndCrashesDUnitTest {
   public static void classSetup() {
     locator = cluster.startLocatorVM(0);
 
-    server1 = startRedisVM(1, 0);
-    server2 = startRedisVM(2, 0);
-    server3 = startRedisVM(3, 0);
+    redisPorts = AvailablePortHelper.getRandomAvailableTCPPorts(3);
 
-    redisPorts = new int[] {
-        cluster.getRedisPort(1),
-        cluster.getRedisPort(2),
-        cluster.getRedisPort(3)};
+    startRedisVM(1, redisPorts[0]);
+    server2 = startRedisVM(2, redisPorts[1]);
+    server3 = startRedisVM(3, redisPorts[2]);
 
-    jedis = new JedisCluster(new HostAndPort("localhost", redisPorts[0]), 
JEDIS_TIMEOUT);
+    new JedisCluster(new HostAndPort("localhost", redisPorts[0]), 
JEDIS_TIMEOUT);
   }
 
   private static MemberVM startRedisVM(int vmId, Integer redisPort) {

Reply via email to