Skip to content

Commit 87b680a

Browse files
committed
Avoid using port 7443 in Lettuce tests #2326
MDM ftw 🙄
1 parent d09e66f commit 87b680a

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ work/cluster-node-7479.conf:
207207
@echo cluster-enabled yes >> $@
208208
@echo cluster-node-timeout 150 >> $@
209209
@echo cluster-config-file $(shell pwd)/work/cluster-node-config-7479.conf >> $@
210-
@echo cluster-announce-port 7443 >> $@
210+
@echo cluster-announce-port 7442 >> $@
211211
@echo requirepass foobared >> $@
212212

213213

@@ -289,7 +289,7 @@ work/stunnel.conf:
289289
@echo key=$(ROOT_DIR)/work/ca/private/foo-host.decrypted.key.pem >> $@
290290

291291
@echo [ssl-cluster-node-1] >> $@
292-
@echo accept = 127.0.0.1:7443 >> $@
292+
@echo accept = 127.0.0.1:7442 >> $@
293293
@echo connect = 127.0.0.1:7479 >> $@
294294

295295
@echo [ssl-cluster-node-2] >> $@

src/test/java/io/lettuce/core/cluster/RedisClusterPasswordSecuredSslIntegrationTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
*/
4545
class RedisClusterPasswordSecuredSslIntegrationTests extends TestSupport {
4646

47-
private static final int CLUSTER_PORT_SSL_1 = 7443;
47+
private static final int CLUSTER_PORT_SSL_1 = 7442;
4848

4949
private static final int CLUSTER_PORT_SSL_2 = 7444; // replica cannot replicate properly with upstream
5050
private static final int CLUSTER_PORT_SSL_3 = 7445;
@@ -58,7 +58,7 @@ class RedisClusterPasswordSecuredSslIntegrationTests extends TestSupport {
5858

5959
@BeforeEach
6060
void before() {
61-
assumeTrue(CanConnect.to(host(), CLUSTER_PORT_SSL_1), "Assume that stunnel runs on port 7443");
61+
assumeTrue(CanConnect.to(host(), CLUSTER_PORT_SSL_1), "Assume that stunnel runs on port 7442");
6262
assumeTrue(CanConnect.to(host(), CLUSTER_PORT_SSL_2), "Assume that stunnel runs on port 7444");
6363
assumeTrue(CanConnect.to(host(), CLUSTER_PORT_SSL_3), "Assume that stunnel runs on port 7445");
6464
assumeTrue(CanConnect.to(host(), 7479), "Assume that Redis runs on port 7479");
@@ -117,7 +117,7 @@ void nodeConnectionsShouldWork() {
117117
try {
118118
node2Connection.sync().get(SLOT_1_KEY);
119119
} catch (RedisCommandExecutionException e) {
120-
assertThat(e).hasMessage("MOVED 1 127.0.0.1:7443");
120+
assertThat(e).hasMessage("MOVED 1 127.0.0.1:7442");
121121
}
122122

123123
connection.close();

src/test/java/io/lettuce/test/settings/TestSettings.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ public static int port(int offset) {
150150
* @return {@link #sslPort()} with added {@literal offset}
151151
*/
152152
public static int sslPort(int offset) {
153-
return sslPort() + offset;
153+
int port = sslPort() + offset;
154+
if (port == 7443) {
155+
throw new IllegalStateException("Please use a different port than 7443. Thank you.");
156+
}
157+
return port;
154158
}
159+
155160
}

0 commit comments

Comments
 (0)