svn merge -c 1591030 FIXES: 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/branches/branch-2@1591031 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2014-04-29 17:49:09 +00:00
parent 8be14bbf65
commit 413d84fabb
2 changed files with 15 additions and 9 deletions

View File

@ -64,6 +64,9 @@ Release 2.5.0 - UNRELEASED
YARN-1865. ShellScriptBuilder does not check for some error conditions. YARN-1865. ShellScriptBuilder does not check for some error conditions.
(Remus Rusanu via ivanmi) (Remus Rusanu via ivanmi)
YARN-738. TestClientRMTokens is failing irregularly while running all yarn
tests (Ming Ma via jlowe)
Release 2.4.1 - UNRELEASED Release 2.4.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -36,6 +36,7 @@ import java.net.InetSocketAddress;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction; import java.security.PrivilegedExceptionAction;
import org.apache.hadoop.net.NetUtils;
import org.junit.Assert; import org.junit.Assert;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -235,8 +236,8 @@ public class TestClientRMTokens {
@Test @Test
public void testShortCircuitRenewCancel() public void testShortCircuitRenewCancel()
throws IOException, InterruptedException { throws IOException, InterruptedException {
InetSocketAddress addr = InetSocketAddress addr = NetUtils.createSocketAddr(
new InetSocketAddress(InetAddress.getLocalHost(), 123); InetAddress.getLocalHost().getHostName(), 123, null);
checkShortCircuitRenewCancel(addr, addr, true); checkShortCircuitRenewCancel(addr, addr, true);
} }
@ -244,17 +245,19 @@ public class TestClientRMTokens {
public void testShortCircuitRenewCancelWildcardAddress() public void testShortCircuitRenewCancelWildcardAddress()
throws IOException, InterruptedException { throws IOException, InterruptedException {
InetSocketAddress rmAddr = new InetSocketAddress(123); InetSocketAddress rmAddr = new InetSocketAddress(123);
InetSocketAddress serviceAddr = NetUtils.createSocketAddr(
InetAddress.getLocalHost().getHostName(), rmAddr.getPort(), null);
checkShortCircuitRenewCancel( checkShortCircuitRenewCancel(
rmAddr, rmAddr,
new InetSocketAddress(InetAddress.getLocalHost(), rmAddr.getPort()), serviceAddr,
true); true);
} }
@Test @Test
public void testShortCircuitRenewCancelSameHostDifferentPort() public void testShortCircuitRenewCancelSameHostDifferentPort()
throws IOException, InterruptedException { throws IOException, InterruptedException {
InetSocketAddress rmAddr = InetSocketAddress rmAddr = NetUtils.createSocketAddr(
new InetSocketAddress(InetAddress.getLocalHost(), 123); InetAddress.getLocalHost().getHostName(), 123, null);
checkShortCircuitRenewCancel( checkShortCircuitRenewCancel(
rmAddr, rmAddr,
new InetSocketAddress(rmAddr.getAddress(), rmAddr.getPort()+1), new InetSocketAddress(rmAddr.getAddress(), rmAddr.getPort()+1),
@ -264,8 +267,8 @@ public class TestClientRMTokens {
@Test @Test
public void testShortCircuitRenewCancelDifferentHostSamePort() public void testShortCircuitRenewCancelDifferentHostSamePort()
throws IOException, InterruptedException { throws IOException, InterruptedException {
InetSocketAddress rmAddr = InetSocketAddress rmAddr = NetUtils.createSocketAddr(
new InetSocketAddress(InetAddress.getLocalHost(), 123); InetAddress.getLocalHost().getHostName(), 123, null);
checkShortCircuitRenewCancel( checkShortCircuitRenewCancel(
rmAddr, rmAddr,
new InetSocketAddress("1.1.1.1", rmAddr.getPort()), new InetSocketAddress("1.1.1.1", rmAddr.getPort()),
@ -275,8 +278,8 @@ public class TestClientRMTokens {
@Test @Test
public void testShortCircuitRenewCancelDifferentHostDifferentPort() public void testShortCircuitRenewCancelDifferentHostDifferentPort()
throws IOException, InterruptedException { throws IOException, InterruptedException {
InetSocketAddress rmAddr = InetSocketAddress rmAddr = NetUtils.createSocketAddr(
new InetSocketAddress(InetAddress.getLocalHost(), 123); InetAddress.getLocalHost().getHostName(), 123, null);
checkShortCircuitRenewCancel( checkShortCircuitRenewCancel(
rmAddr, rmAddr,
new InetSocketAddress("1.1.1.1", rmAddr.getPort()+1), new InetSocketAddress("1.1.1.1", rmAddr.getPort()+1),