Skip to content

Commit e7dbac0

Browse files
committed
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
1 parent 848902b commit e7dbac0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ Release 2.0.1-alpha - UNRELEASED
204204
HDFS-2759. Pre-allocate HDFS edit log files after writing version number.
205205
(atm)
206206

207+
HDFS-3413. TestFailureToReadEdits timing out. (atm)
208+
207209
Release 2.0.0-alpha - UNRELEASED
208210

209211
INCOMPATIBLE CHANGES

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestFailureToReadEdits.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,21 @@ public void testFailureToReadEditsOnTransitionToActive() throws Exception {
256256
// Shutdown the active NN.
257257
cluster.shutdownNameNode(0);
258258

259+
Runtime mockRuntime = mock(Runtime.class);
260+
cluster.getNameNode(1).setRuntimeForTesting(mockRuntime);
261+
verify(mockRuntime, times(0)).exit(anyInt());
259262
try {
260263
// Transition the standby to active.
261264
cluster.transitionToActive(1);
262265
fail("Standby transitioned to active, but should not have been able to");
263266
} catch (ServiceFailedException sfe) {
264-
LOG.info("got expected exception: " + sfe.toString(), sfe);
267+
Throwable sfeCause = sfe.getCause();
268+
LOG.info("got expected exception: " + sfeCause.toString(), sfeCause);
265269
assertTrue("Standby failed to catch up for some reason other than "
266-
+ "failure to read logs", sfe.toString().contains(
270+
+ "failure to read logs", sfeCause.getCause().toString().contains(
267271
EditLogInputException.class.getName()));
268272
}
273+
verify(mockRuntime, times(1)).exit(anyInt());
269274
}
270275

271276
private LimitedEditLogAnswer causeFailureOnEditLogRead() throws IOException {

0 commit comments

Comments
 (0)