From 6f0eb6f5b1ae7948b434bb05d07590b23cb331fd Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Thu, 3 Jan 2013 02:25:08 +0000 Subject: [PATCH] HDFS-4338. TestNameNodeMetrics#testCorruptBlock is flaky. Contributed by Andrew Wang. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1428144 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hdfs/server/namenode/metrics/TestNameNodeMetrics.java | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 19260b561d..dc7e02c7b2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -288,6 +288,9 @@ Trunk (Unreleased) HDFS-4275. MiniDFSCluster-based tests fail on Windows due to failure to delete test namenode directory. (Chris Nauroth via suresh) + HDFS-4338. TestNameNodeMetrics#testCorruptBlock is flaky. (Andrew Wang via + atm) + Release 2.0.3-alpha - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java index 96a9966917..d31f12ddfa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java @@ -222,11 +222,9 @@ public void testCorruptBlock() throws Exception { cluster.getNamesystem().writeUnlock(); } BlockManagerTestUtil.getComputedDatanodeWork(bm); - BlockManagerTestUtil.updateState(bm); MetricsRecordBuilder rb = getMetrics(NS_METRICS); assertGauge("CorruptBlocks", 1L, rb); assertGauge("PendingReplicationBlocks", 1L, rb); - assertGauge("ScheduledReplicationBlocks", 1L, rb); fs.delete(file, true); // During the file deletion, both BlockManager#corruptReplicas and @@ -235,7 +233,7 @@ public void testCorruptBlock() throws Exception { // corruptReplicas and pendingReplications. The corresponding // metrics (CorruptBlocks and PendingReplicationBlocks) will only be updated // when BlockManager#computeDatanodeWork is run where the - // BlockManager#udpateState is called. And in + // BlockManager#updateState is called. And in // BlockManager#computeDatanodeWork the metric ScheduledReplicationBlocks // will also be updated. rb = waitForDnMetricValue(NS_METRICS, "CorruptBlocks", 0L);