Repository: hadoop Updated Branches: refs/heads/branch-2 e26be1d85 -> 74d40b3d9
HDFS-7361. TestCheckpoint fails after change of log message related to locking violation. Contributed by Konstantin Shvachko. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/74d40b3d Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/74d40b3d Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/74d40b3d Branch: refs/heads/branch-2 Commit: 74d40b3d9edcb2c5e8f3fd719fb3f45bfff6bc3b Parents: e26be1d Author: Konstantin V Shvachko <s...@apache.org> Authored: Wed Nov 5 20:23:13 2014 -0800 Committer: Konstantin V Shvachko <s...@apache.org> Committed: Wed Nov 5 20:23:13 2014 -0800 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/namenode/TestCheckpoint.java | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/74d40b3d/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index ab22540..fb87dc1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -86,6 +86,9 @@ Release 2.7.0 - UNRELEASED HDFS-7333. Improve logging in Storage.tryLock(). (shv) + HDFS-7361. TestCheckpoint fails after change of log message related to + locking violation. (shv) + OPTIMIZATIONS BUG FIXES http://git-wip-us.apache.org/repos/asf/hadoop/blob/74d40b3d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java index b78e2f8..e34bc2b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java @@ -846,7 +846,7 @@ public class TestCheckpoint { } /** - * Test that, an attempt to lock a storage that is already locked by a nodename, + * Test that, an attempt to lock a storage that is already locked by nodename, * logs error message that includes JVM name of the namenode that locked it. */ @Test @@ -862,16 +862,18 @@ public class TestCheckpoint { savedSd = sd; } - LogCapturer logs = GenericTestUtils.LogCapturer.captureLogs(LogFactory.getLog(Storage.class)); + LogCapturer logs = GenericTestUtils.LogCapturer.captureLogs( + LogFactory.getLog(Storage.class)); try { // try to lock the storage that's already locked savedSd.lock(); - fail("Namenode should not be able to lock a storage that is already locked"); + fail("Namenode should not be able to lock a storage" + + " that is already locked"); } catch (IOException ioe) { // cannot read lock file on Windows, so message cannot get JVM name String lockingJvmName = Path.WINDOWS ? "" : " " + ManagementFactory.getRuntimeMXBean().getName(); - String expectedLogMessage = "It appears that another namenode" + String expectedLogMessage = "It appears that another node " + lockingJvmName + " has already locked the storage directory"; assertTrue("Log output does not contain expected log message: " + expectedLogMessage, logs.getOutput().contains(expectedLogMessage));