Skip to content

Commit 35005c6

Browse files
committed
Use random ports for RestTest
1 parent 20cba4a commit 35005c6

File tree

1 file changed

+7
-2
lines changed
  • operator/src/test/java/oracle/kubernetes/operator/rest

1 file changed

+7
-2
lines changed

operator/src/test/java/oracle/kubernetes/operator/rest/RestTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ private Invocation.Builder request(WebTarget target, String uri) {
336336
}
337337

338338
private static class TestRestConfigImpl implements RestConfig {
339+
private final int randomPort;
340+
341+
public TestRestConfigImpl() {
342+
randomPort = (int) (Math.random() * 8000) + 1000;
343+
}
339344

340345
@Override
341346
public String getHost() {
@@ -346,12 +351,12 @@ public String getHost() {
346351

347352
@Override
348353
public int getExternalHttpsPort() {
349-
return 8766;
354+
return randomPort;
350355
}
351356

352357
@Override
353358
public int getInternalHttpsPort() {
354-
return 8767;
359+
return randomPort + 1;
355360
}
356361

357362
@Override

0 commit comments

Comments
 (0)