From 7286e8a9daefac8ec5135482b716dd0ce4792952 Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Wed, 16 May 2012 16:24:38 +0000 Subject: [PATCH] HDFS-3413. TestFailureToReadEdits timing out. Contributed by Aaron T. Myers. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1339250 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../hdfs/server/namenode/ha/TestFailureToReadEdits.java | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index b65f3716e8a..67d5c81bcba 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -204,6 +204,8 @@ Release 2.0.1-alpha - UNRELEASED HDFS-2759. Pre-allocate HDFS edit log files after writing version number. (atm) + HDFS-3413. TestFailureToReadEdits timing out. (atm) + Release 2.0.0-alpha - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureToReadEdits.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureToReadEdits.java index 7bc2d8e1645..97effd449a7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureToReadEdits.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureToReadEdits.java @@ -256,16 +256,21 @@ public void testFailureToReadEditsOnTransitionToActive() throws Exception { // Shutdown the active NN. cluster.shutdownNameNode(0); + Runtime mockRuntime = mock(Runtime.class); + cluster.getNameNode(1).setRuntimeForTesting(mockRuntime); + verify(mockRuntime, times(0)).exit(anyInt()); try { // Transition the standby to active. cluster.transitionToActive(1); fail("Standby transitioned to active, but should not have been able to"); } catch (ServiceFailedException sfe) { - LOG.info("got expected exception: " + sfe.toString(), sfe); + Throwable sfeCause = sfe.getCause(); + LOG.info("got expected exception: " + sfeCause.toString(), sfeCause); assertTrue("Standby failed to catch up for some reason other than " - + "failure to read logs", sfe.toString().contains( + + "failure to read logs", sfeCause.getCause().toString().contains( EditLogInputException.class.getName())); } + verify(mockRuntime, times(1)).exit(anyInt()); } private LimitedEditLogAnswer causeFailureOnEditLogRead() throws IOException {