You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2022/02/01 20:44:08 UTC

[geode] 02/02: GEODE-9995: Use ephemeral ports to avoid port in use issues (#7329)

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

jensdeppe pushed a commit to branch support/1.15
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 55396d4650f5214b27982b43ea7b59d05a23ba55
Author: Jens Deppe <jd...@vmware.com>
AuthorDate: Mon Jan 31 12:04:15 2022 -0800

    GEODE-9995: Use ephemeral ports to avoid port in use issues (#7329)
    
    (cherry picked from commit 00ccce2a652e6fe21b8af8a162cff35ab47f036c)
---
 ...eRedisServerStartupUsingGfshAcceptanceTest.java | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/geode-for-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/commands/executor/GeodeRedisServerStartupUsingGfshAcceptanceTest.java b/geode-for-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/commands/executor/GeodeRedisServerStartupUsingGfshAcceptanceTest.java
index 6ce72a5..1377510 100644
--- a/geode-for-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/commands/executor/GeodeRedisServerStartupUsingGfshAcceptanceTest.java
+++ b/geode-for-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/commands/executor/GeodeRedisServerStartupUsingGfshAcceptanceTest.java
@@ -108,8 +108,8 @@ public class GeodeRedisServerStartupUsingGfshAcceptanceTest {
 
   @Test
   public void gfshStartsRedisServer_whenRedisEnabled() {
-    String command =
-        "start server --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_ENABLED + "=true";
+    String command = "start server --server-port=0 "
+        + "--J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_ENABLED + "=true";
     gfshRule.execute(command);
 
     try (Jedis jedis = new Jedis(BIND_ADDRESS, 6379)) {
@@ -120,9 +120,9 @@ public class GeodeRedisServerStartupUsingGfshAcceptanceTest {
   @Test
   public void gfshStartsRedisServer_whenCustomPort() {
     int port = AvailablePortHelper.getRandomAvailableTCPPort();
-    String command =
-        "start server --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_ENABLED + "=true"
-            + " --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_PORT + "=" + port;
+    String command = "start server --server-port=0 "
+        + "--J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_ENABLED + "=true"
+        + " --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_PORT + "=" + port;
 
     gfshRule.execute(command);
 
@@ -135,11 +135,11 @@ public class GeodeRedisServerStartupUsingGfshAcceptanceTest {
   public void gfshStartsRedisServer_whenCustomPortAndBindAddress() {
     int port = AvailablePortHelper.getRandomAvailableTCPPort();
     String anyLocal = LocalHostUtil.getAnyLocalAddress().getHostAddress();
-    String command =
-        "start server --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_ENABLED + "=true"
-            + " --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_PORT + "=" + port
-            + " --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_BIND_ADDRESS + "="
-            + anyLocal;
+    String command = "start server --server-port=0 "
+        + "--J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_ENABLED + "=true"
+        + " --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_PORT + "=" + port
+        + " --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_BIND_ADDRESS + "="
+        + anyLocal;
 
     gfshRule.execute(command);
 
@@ -152,10 +152,10 @@ public class GeodeRedisServerStartupUsingGfshAcceptanceTest {
   public void gfshDoesNotStartRedisServer_whenNotRedisEnabled() {
     int port = AvailablePortHelper.getRandomAvailableTCPPort();
     String anyLocal = LocalHostUtil.getAnyLocalAddress().getHostAddress();
-    String command =
-        "start server --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_PORT + "=" + port
-            + " --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_BIND_ADDRESS + "="
-            + anyLocal;
+    String command = "start server --server-port=0 "
+        + "--J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_PORT + "=" + port
+        + " --J=-Dgemfire." + ConfigurationProperties.GEODE_FOR_REDIS_BIND_ADDRESS + "="
+        + anyLocal;
 
     gfshRule.execute(command);