Copilot commented on code in PR #6836:
URL: https://github.com/apache/hive/pull/6836#discussion_r4161271526
##########
standalone-metastore/metastore-rest-catalog/src/test/java/org/apache/iceberg/rest/extension/JwksServer.java:
##########
@@ -43,12 +44,20 @@ public class JwksServer {
private static final File JWT_NOAUTHKEY_FILE =
new File(BASE_DIR,
"src/test/resources/auth/jwt/jwt-unauthorized-key.json");
private static final File JWT_JWKS_FILE = new File(BASE_DIR,
"src/test/resources/auth/jwt/jwt-verification-jwks.json");
- private static final int MOCK_JWKS_SERVER_PORT = 8089;
+ private final int port;
private WireMockRule mockJwksSever;
+ JwksServer() {
+ try {
+ port = MetaStoreTestUtils.findFreePort();
Review Comment:
`findFreePort()` closes its probe socket before WireMock binds it. Both
static JWT extensions are constructed before either `beforeAll` starts, so they
can select the same port (or another process can claim it), causing a
nondeterministic bind failure. Have WireMock bind a dynamic port and update the
JWKS URL from its actual port after startup instead of preselecting an
unreserved port.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]