diff --git a/Makefile b/Makefile index b855d0d3cf..c5a0d97a58 100644 --- a/Makefile +++ b/Makefile @@ -207,7 +207,7 @@ work/cluster-node-7479.conf: @echo cluster-enabled yes >> $@ @echo cluster-node-timeout 150 >> $@ @echo cluster-config-file $(shell pwd)/work/cluster-node-config-7479.conf >> $@ - @echo cluster-announce-port 7443 >> $@ + @echo cluster-announce-port 7442 >> $@ @echo requirepass foobared >> $@ @@ -289,7 +289,7 @@ work/stunnel.conf: @echo key=$(ROOT_DIR)/work/ca/private/foo-host.decrypted.key.pem >> $@ @echo [ssl-cluster-node-1] >> $@ - @echo accept = 127.0.0.1:7443 >> $@ + @echo accept = 127.0.0.1:7442 >> $@ @echo connect = 127.0.0.1:7479 >> $@ @echo [ssl-cluster-node-2] >> $@ diff --git a/src/test/java/io/lettuce/core/cluster/RedisClusterPasswordSecuredSslIntegrationTests.java b/src/test/java/io/lettuce/core/cluster/RedisClusterPasswordSecuredSslIntegrationTests.java index 6da62b4d2f..160bc016b7 100644 --- a/src/test/java/io/lettuce/core/cluster/RedisClusterPasswordSecuredSslIntegrationTests.java +++ b/src/test/java/io/lettuce/core/cluster/RedisClusterPasswordSecuredSslIntegrationTests.java @@ -44,7 +44,7 @@ */ class RedisClusterPasswordSecuredSslIntegrationTests extends TestSupport { - private static final int CLUSTER_PORT_SSL_1 = 7443; + private static final int CLUSTER_PORT_SSL_1 = 7442; private static final int CLUSTER_PORT_SSL_2 = 7444; // replica cannot replicate properly with upstream private static final int CLUSTER_PORT_SSL_3 = 7445; @@ -58,7 +58,7 @@ class RedisClusterPasswordSecuredSslIntegrationTests extends TestSupport { @BeforeEach void before() { - assumeTrue(CanConnect.to(host(), CLUSTER_PORT_SSL_1), "Assume that stunnel runs on port 7443"); + assumeTrue(CanConnect.to(host(), CLUSTER_PORT_SSL_1), "Assume that stunnel runs on port 7442"); assumeTrue(CanConnect.to(host(), CLUSTER_PORT_SSL_2), "Assume that stunnel runs on port 7444"); assumeTrue(CanConnect.to(host(), CLUSTER_PORT_SSL_3), "Assume that stunnel runs on port 7445"); assumeTrue(CanConnect.to(host(), 7479), "Assume that Redis runs on port 7479"); @@ -117,7 +117,7 @@ void nodeConnectionsShouldWork() { try { node2Connection.sync().get(SLOT_1_KEY); } catch (RedisCommandExecutionException e) { - assertThat(e).hasMessage("MOVED 1 127.0.0.1:7443"); + assertThat(e).hasMessage("MOVED 1 127.0.0.1:7442"); } connection.close(); diff --git a/src/test/java/io/lettuce/test/settings/TestSettings.java b/src/test/java/io/lettuce/test/settings/TestSettings.java index 663716e84e..b6312113e3 100644 --- a/src/test/java/io/lettuce/test/settings/TestSettings.java +++ b/src/test/java/io/lettuce/test/settings/TestSettings.java @@ -150,6 +150,11 @@ public static int port(int offset) { * @return {@link #sslPort()} with added {@literal offset} */ public static int sslPort(int offset) { - return sslPort() + offset; + int port = sslPort() + offset; + if (port == 7443) { + throw new IllegalStateException("Please use a different port than 7443. Thank you."); + } + return port; } + }