This is an automated email from the ASF dual-hosted git repository. slfan1989 pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push: new fba01e69556 YARN-11797. Fix tests trying to connect to 0.0.0.0 (#7515) Contributed by Istvan Toth. fba01e69556 is described below commit fba01e695567693e3fb59820af5af4f19401940d Author: Istvan Toth <st...@apache.org> AuthorDate: Wed Mar 19 02:12:20 2025 +0100 YARN-11797. Fix tests trying to connect to 0.0.0.0 (#7515) Contributed by Istvan Toth. Signed-off-by: Shilun Fan <slfan1...@apache.org> --- .../java/org/apache/hadoop/yarn/client/TestRMFailover.java | 10 +++++----- .../apache/hadoop/yarn/server/resourcemanager/HATestUtil.java | 2 +- .../org/apache/hadoop/yarn/server/TestMiniYarnCluster.java | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java index a744714846b..50910490103 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java @@ -216,7 +216,7 @@ public void testWebAppProxyInStandAloneMode() throws YarnException, WebAppProxyServer webAppProxyServer = new WebAppProxyServer(); try { - conf.set(YarnConfiguration.PROXY_ADDRESS, "0.0.0.0:9099"); + conf.set(YarnConfiguration.PROXY_ADDRESS, "localhost:9099"); cluster.init(conf); cluster.start(); getAdminService(0).transitionToActive(req); @@ -231,7 +231,7 @@ public void testWebAppProxyInStandAloneMode() throws YarnException, // send httpRequest with fakeApplicationId // expect to get "Not Found" response and 404 response code - URL wrongUrl = new URL("http://0.0.0.0:9099/proxy/" + fakeAppId); + URL wrongUrl = new URL("http://localhost:9099/proxy/" + fakeAppId); HttpURLConnection proxyConn = (HttpURLConnection) wrongUrl .openConnection(); @@ -258,7 +258,7 @@ public void testEmbeddedWebAppProxy() throws YarnException, // send httpRequest with fakeApplicationId // expect to get "Not Found" response and 404 response code - URL wrongUrl = new URL("http://0.0.0.0:18088/proxy/" + fakeAppId); + URL wrongUrl = new URL("http://localhost:18088/proxy/" + fakeAppId); HttpURLConnection proxyConn = (HttpURLConnection) wrongUrl .openConnection(); @@ -286,8 +286,8 @@ public void testRMWebAppRedirect() throws YarnException, cluster.init(conf); cluster.start(); getAdminService(0).transitionToActive(req); - String rm1Url = "http://0.0.0.0:18088"; - String rm2Url = "http://0.0.0.0:28088"; + String rm1Url = "http://localhost:18088"; + String rm2Url = "http://localhost:28088"; String redirectURL = getRedirectURL(rm2Url); // if uri is null, RMWebAppFilter will append a slash at the trail of the redirection url diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/HATestUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/HATestUtil.java index ac245c3207d..0f258fa5b5d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/HATestUtil.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/HATestUtil.java @@ -29,7 +29,7 @@ public class HATestUtil { public static void setRpcAddressForRM(String rmId, int base, Configuration conf) throws IOException { for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) { - setConfForRM(rmId, confKey, "0.0.0.0:" + ServerSocketUtil.getPort(base + + setConfForRM(rmId, confKey, "localhost:" + ServerSocketUtil.getPort(base + YarnConfiguration.getRMDefaultPortNumber(confKey, conf), 10), conf); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnCluster.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnCluster.java index c5c2e3e0f5e..02d6eac3277 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnCluster.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnCluster.java @@ -136,18 +136,18 @@ void testMultiRMConf() throws IOException { Configuration conf1 = cluster.getResourceManager(0).getConfig(), conf2 = cluster.getResourceManager(1).getConfig(); assertFalse(conf1 == conf2); - assertEquals("0.0.0.0:18032", + assertEquals("localhost:18032", conf1.get(HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, RM1_NODE_ID))); - assertEquals("0.0.0.0:28032", + assertEquals("localhost:28032", conf1.get(HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, RM2_NODE_ID))); assertEquals("rm1", conf1.get(YarnConfiguration.RM_HA_ID)); - assertEquals("0.0.0.0:18032", + assertEquals("localhost:18032", conf2.get(HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, RM1_NODE_ID))); - assertEquals("0.0.0.0:28032", + assertEquals("localhost:28032", conf2.get(HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, RM2_NODE_ID))); assertEquals("rm2", conf2.get(YarnConfiguration.RM_HA_ID)); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org