From 744e382487df7fa0a20c0a0901bee3c9f6241e93 Mon Sep 17 00:00:00 2001 From: Terence Date: Tue, 15 Sep 2020 10:56:46 +0800 Subject: [PATCH] Probe for available port --- .../test/java/feast/core/auth/CoreServiceAuthenticationIT.java | 3 ++- .../test/java/feast/core/auth/CoreServiceAuthorizationIT.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/feast/core/auth/CoreServiceAuthenticationIT.java b/core/src/test/java/feast/core/auth/CoreServiceAuthenticationIT.java index 9ecea9a290d..d6f13fdb55d 100644 --- a/core/src/test/java/feast/core/auth/CoreServiceAuthenticationIT.java +++ b/core/src/test/java/feast/core/auth/CoreServiceAuthenticationIT.java @@ -41,6 +41,7 @@ import org.springframework.boot.test.context.TestConfiguration; import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertySource; +import org.springframework.util.SocketUtils; @SpringBootTest( properties = { @@ -52,7 +53,7 @@ public class CoreServiceAuthenticationIT extends BaseIT { @Autowired FeastProperties feastProperties; private static int feast_core_port; - private static int JWKS_PORT = 45124; + private static int JWKS_PORT = SocketUtils.findAvailableTcpPort(); private static JwtHelper jwtHelper = new JwtHelper(); diff --git a/core/src/test/java/feast/core/auth/CoreServiceAuthorizationIT.java b/core/src/test/java/feast/core/auth/CoreServiceAuthorizationIT.java index 0c430b0915d..584fcc3854a 100644 --- a/core/src/test/java/feast/core/auth/CoreServiceAuthorizationIT.java +++ b/core/src/test/java/feast/core/auth/CoreServiceAuthorizationIT.java @@ -51,6 +51,7 @@ import org.springframework.boot.test.context.TestConfiguration; import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertySource; +import org.springframework.util.SocketUtils; import org.testcontainers.containers.DockerComposeContainer; import sh.ory.keto.ApiClient; import sh.ory.keto.ApiException; @@ -73,7 +74,7 @@ public class CoreServiceAuthorizationIT extends BaseIT { private static int KETO_PORT = 4466; private static int KETO_ADAPTOR_PORT = 8080; private static int feast_core_port; - private static int JWKS_PORT = 45124; + private static int JWKS_PORT = SocketUtils.findAvailableTcpPort(); private static JwtHelper jwtHelper = new JwtHelper();