From c63e2b93247818899b61786bd4912b379032abc7 Mon Sep 17 00:00:00 2001 From: Raju Balpande <146973984+raju-balpande@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:55:27 +0530 Subject: [PATCH] HDDS-10132. TestStorageContainerManager.testScmProcessDatanodeHeartbeat fails with Java 17 (#6516) --- .../hadoop/hdds/scm/TestStorageContainerManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java index 474a1869485..95d7faa9174 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java @@ -167,6 +167,7 @@ */ @Timeout(900) public class TestStorageContainerManager { + private static final String LOCALHOST_IP = "127.0.0.1"; private static XceiverClientManager xceiverClientManager; private static final Logger LOG = LoggerFactory.getLogger( TestStorageContainerManager.class); @@ -693,11 +694,15 @@ public void testScmInfo(@TempDir Path tempDir) throws Exception { */ @Test public void testScmProcessDatanodeHeartbeat() throws Exception { + String rackName = "/rack1"; OzoneConfiguration conf = new OzoneConfiguration(); conf.setClass(NET_TOPOLOGY_NODE_SWITCH_MAPPING_IMPL_KEY, StaticMapping.class, DNSToSwitchMapping.class); StaticMapping.addNodeToRack(NetUtils.normalizeHostName(HddsUtils.getHostName(conf)), - "/rack1"); + rackName); + // In case of JDK17, the IP address is resolved to localhost mapped to 127.0.0.1 which is not in sync with JDK8 + // and hence need to make following entry under HDDS-10132 + StaticMapping.addNodeToRack(LOCALHOST_IP, rackName); final int datanodeNum = 3;