Repository: hadoop Updated Branches: refs/heads/branch-2 ac2ed09be -> d5936aa48
HADOOP-12417. TestWebDelegationToken failing with port in use. Contributed by Mingliang Liu. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d5936aa4 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d5936aa4 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d5936aa4 Branch: refs/heads/branch-2 Commit: d5936aa48cafda43bab57578708d880fc68e405a Parents: ac2ed09 Author: Haohui Mai <[email protected]> Authored: Wed Sep 16 18:38:37 2015 -0700 Committer: Haohui Mai <[email protected]> Committed: Wed Sep 16 18:38:54 2015 -0700 ---------------------------------------------------------------------- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../security/token/delegation/web/TestWebDelegationToken.java | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/d5936aa4/hadoop-common-project/hadoop-common/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 9ca49e2..116b350 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -620,6 +620,9 @@ Release 2.8.0 - UNRELEASED HADOOP-12407. Test failing: hadoop.ipc.TestSaslRPC. (stevel) + HADOOP-12417. TestWebDelegationToken failing with port in use. + (Mingliang Liu via wheat9) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/d5936aa4/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java index d18f968..73562b5 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java @@ -176,13 +176,8 @@ public class TestWebDelegationToken { protected Server createJettyServer() { try { - InetAddress localhost = InetAddress.getLocalHost(); - ServerSocket ss = new ServerSocket(0, 50, localhost); - int port = ss.getLocalPort(); - ss.close(); jetty = new Server(0); jetty.getConnectors()[0].setHost("localhost"); - jetty.getConnectors()[0].setPort(port); return jetty; } catch (Exception ex) { throw new RuntimeException("Could not setup Jetty: " + ex.getMessage(), @@ -192,7 +187,7 @@ public class TestWebDelegationToken { protected String getJettyURL() { Connector c = jetty.getConnectors()[0]; - return "http://" + c.getHost() + ":" + c.getPort(); + return "http://" + c.getHost() + ":" + c.getLocalPort(); } @Before
