Skip to content

Commit 478b6ae

Browse files
committed
YARN-738. TestClientRMTokens is failing irregularly while running all yarn tests. Contributed by Ming Ma
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1591030 13f79535-47bb-0310-9956-ffa450edef68
1 parent fbe5d49 commit 478b6ae

File tree

2 files changed

+15
-9
lines changed
  • hadoop-yarn-project

2 files changed

+15
-9
lines changed

hadoop-yarn-project/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ Release 2.5.0 - UNRELEASED
7979
YARN-1865. ShellScriptBuilder does not check for some error conditions.
8080
(Remus Rusanu via ivanmi)
8181

82+
YARN-738. TestClientRMTokens is failing irregularly while running all yarn
83+
tests (Ming Ma via jlowe)
84+
8285
Release 2.4.1 - UNRELEASED
8386

8487
INCOMPATIBLE CHANGES

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMTokens.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.security.PrivilegedAction;
3737
import java.security.PrivilegedExceptionAction;
3838

39+
import org.apache.hadoop.net.NetUtils;
3940
import org.junit.Assert;
4041

4142
import org.apache.commons.logging.Log;
@@ -235,26 +236,28 @@ public void testDelegationToken() throws IOException, InterruptedException {
235236
@Test
236237
public void testShortCircuitRenewCancel()
237238
throws IOException, InterruptedException {
238-
InetSocketAddress addr =
239-
new InetSocketAddress(InetAddress.getLocalHost(), 123);
239+
InetSocketAddress addr = NetUtils.createSocketAddr(
240+
InetAddress.getLocalHost().getHostName(), 123, null);
240241
checkShortCircuitRenewCancel(addr, addr, true);
241242
}
242243

243244
@Test
244245
public void testShortCircuitRenewCancelWildcardAddress()
245246
throws IOException, InterruptedException {
246247
InetSocketAddress rmAddr = new InetSocketAddress(123);
248+
InetSocketAddress serviceAddr = NetUtils.createSocketAddr(
249+
InetAddress.getLocalHost().getHostName(), rmAddr.getPort(), null);
247250
checkShortCircuitRenewCancel(
248251
rmAddr,
249-
new InetSocketAddress(InetAddress.getLocalHost(), rmAddr.getPort()),
252+
serviceAddr,
250253
true);
251254
}
252255

253256
@Test
254257
public void testShortCircuitRenewCancelSameHostDifferentPort()
255258
throws IOException, InterruptedException {
256-
InetSocketAddress rmAddr =
257-
new InetSocketAddress(InetAddress.getLocalHost(), 123);
259+
InetSocketAddress rmAddr = NetUtils.createSocketAddr(
260+
InetAddress.getLocalHost().getHostName(), 123, null);
258261
checkShortCircuitRenewCancel(
259262
rmAddr,
260263
new InetSocketAddress(rmAddr.getAddress(), rmAddr.getPort()+1),
@@ -264,8 +267,8 @@ public void testShortCircuitRenewCancelSameHostDifferentPort()
264267
@Test
265268
public void testShortCircuitRenewCancelDifferentHostSamePort()
266269
throws IOException, InterruptedException {
267-
InetSocketAddress rmAddr =
268-
new InetSocketAddress(InetAddress.getLocalHost(), 123);
270+
InetSocketAddress rmAddr = NetUtils.createSocketAddr(
271+
InetAddress.getLocalHost().getHostName(), 123, null);
269272
checkShortCircuitRenewCancel(
270273
rmAddr,
271274
new InetSocketAddress("1.1.1.1", rmAddr.getPort()),
@@ -275,8 +278,8 @@ public void testShortCircuitRenewCancelDifferentHostSamePort()
275278
@Test
276279
public void testShortCircuitRenewCancelDifferentHostDifferentPort()
277280
throws IOException, InterruptedException {
278-
InetSocketAddress rmAddr =
279-
new InetSocketAddress(InetAddress.getLocalHost(), 123);
281+
InetSocketAddress rmAddr = NetUtils.createSocketAddr(
282+
InetAddress.getLocalHost().getHostName(), 123, null);
280283
checkShortCircuitRenewCancel(
281284
rmAddr,
282285
new InetSocketAddress("1.1.1.1", rmAddr.getPort()+1),

0 commit comments

Comments
 (0)