Skip to content

Commit

Permalink
HADOOP-12418. TestRPC.testRPCInterruptedSimple fails intermittently. …
Browse files Browse the repository at this point in the history
…Contributed Kihwal Lee.
  • Loading branch information
kihwal committed Oct 20, 2015
1 parent 6381ddc commit 01b103f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Expand Up @@ -1324,6 +1324,9 @@ Release 2.8.0 - UNRELEASED
HADOOP-12474. MiniKMS should use random ports for Jetty server by default.
(Mingliang Liu via wheat9)

HADOOP-12418. TestRPC.testRPCInterruptedSimple fails intermittently.
(kihwal)

Release 2.7.2 - UNRELEASED

INCOMPATIBLE CHANGES
Expand Down
Expand Up @@ -28,6 +28,7 @@
import static org.junit.Assert.fail;

import java.io.Closeable;
import java.io.InterruptedIOException;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
Expand Down Expand Up @@ -885,11 +886,13 @@ public void testRPCInterruptedSimple() throws IOException {
proxy.ping();
fail("Interruption did not cause IPC to fail");
} catch (IOException ioe) {
if (!ioe.toString().contains("InterruptedException")) {
throw ioe;
if (ioe.toString().contains("InterruptedException") ||
ioe instanceof InterruptedIOException) {
// clear interrupt status for future tests
Thread.interrupted();
return;
}
// clear interrupt status for future tests
Thread.interrupted();
throw ioe;
}
} finally {
server.stop();
Expand Down

0 comments on commit 01b103f

Please sign in to comment.