Skip to content

Commit 41f6d3b

Browse files
authored
HDFS-17833. TestObserverReadProxyProvider fails with Java 24 because of InetSocketAddress.toString changes (#7964) Contributed by Istvan Toth.
* HDFS-17833. TestObserverReadProxyProvider fails with Java 24 because of InetSocketAddress.toString changes Signed-off-by: Shilun Fan <[email protected]>
1 parent bcf8c35 commit 41f6d3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverReadProxyProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public ClientProtocol createProxy(Configuration config,
145145
InetSocketAddress nnAddr, Class<ClientProtocol> xface,
146146
UserGroupInformation ugi, boolean withRetries,
147147
AtomicBoolean fallbackToSimpleAuth) {
148-
return proxyMap.get(nnAddr.toString());
148+
return proxyMap.get(nnAddr.toString().replaceAll("/<unresolved>", ""));
149149
}
150150
}) {
151151
@Override
@@ -530,7 +530,8 @@ private void doWrite() throws Exception {
530530
}
531531

532532
private void assertHandledBy(int namenodeIdx) {
533-
assertEquals(namenodeAddrs[namenodeIdx], proxyProvider.getLastProxy().proxyInfo);
533+
assertEquals(namenodeAddrs[namenodeIdx],
534+
proxyProvider.getLastProxy().proxyInfo.replaceAll("/<unresolved>", ""));
534535
}
535536

536537
private static void doWrite(ClientProtocol client) throws Exception {

0 commit comments

Comments
 (0)