HADOOP-9393. TestRPC fails with JDK7. Contributed by Andrew Wang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1455418 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aaron Myers 2013-03-12 06:26:07 +00:00
parent 9daa958c5a
commit f75592f16e
2 changed files with 70 additions and 61 deletions

View File

@ -340,6 +340,8 @@ Trunk (Unreleased)
HADOOP-9264. Port change to use Java untar API on Windows from HADOOP-9264. Port change to use Java untar API on Windows from
branch-1-win to trunk. (Chris Nauroth via suresh) branch-1-win to trunk. (Chris Nauroth via suresh)
HADOOP-9393. TestRPC fails with JDK7. (Andrew Wang via atm)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-7761. Improve the performance of raw comparisons. (todd) HADOOP-7761. Improve the performance of raw comparisons. (todd)

View File

@ -834,6 +834,7 @@ public class TestRPC {
TestProtocol.class, new TestImpl(), ADDRESS, 0, 5, true, conf, null TestProtocol.class, new TestImpl(), ADDRESS, 0, 5, true, conf, null
); );
server.start(); server.start();
try {
InetSocketAddress addr = NetUtils.getConnectAddress(server); InetSocketAddress addr = NetUtils.getConnectAddress(server);
final TestProtocol proxy = (TestProtocol) RPC.getProxy( final TestProtocol proxy = (TestProtocol) RPC.getProxy(
@ -852,6 +853,9 @@ public class TestRPC {
// clear interrupt status for future tests // clear interrupt status for future tests
Thread.interrupted(); Thread.interrupted();
} }
} finally {
server.stop();
}
} }
@Test(timeout=30000) @Test(timeout=30000)
@ -862,7 +866,7 @@ public class TestRPC {
); );
server.start(); server.start();
try {
int numConcurrentRPC = 200; int numConcurrentRPC = 200;
InetSocketAddress addr = NetUtils.getConnectAddress(server); InetSocketAddress addr = NetUtils.getConnectAddress(server);
final CyclicBarrier barrier = new CyclicBarrier(numConcurrentRPC); final CyclicBarrier barrier = new CyclicBarrier(numConcurrentRPC);
@ -915,6 +919,9 @@ public class TestRPC {
// should not cause any other thread to get an error // should not cause any other thread to get an error
assertTrue("rpc got exception " + error.get(), error.get() == null); assertTrue("rpc got exception " + error.get(), error.get() == null);
} finally {
server.stop();
}
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {