Repository: hadoop Updated Branches: refs/heads/branch-2.7 0ad463458 -> 91ca90fdd
HDFS-10275. TestDataNodeMetrics failing intermittently due to TotalWriteTime counted incorrectly. Contributed by Lin Yiqun. (cherry picked from commit ab903029a9d353677184ff5602966b11ffb408b9) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/91ca90fd Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/91ca90fd Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/91ca90fd Branch: refs/heads/branch-2.7 Commit: 91ca90fdd11129f37b32db85c10e9f36cbea08bb Parents: 0ad4634 Author: Walter Su <waltersu4...@apache.org> Authored: Mon Apr 18 20:29:29 2016 +0800 Committer: Walter Su <waltersu4...@apache.org> Committed: Mon Apr 18 20:30:48 2016 +0800 ---------------------------------------------------------------------- .../hadoop/hdfs/server/datanode/TestDataNodeMetrics.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/91ca90fd/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMetrics.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMetrics.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMetrics.java index 3423f02..46d85e8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMetrics.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMetrics.java @@ -257,10 +257,9 @@ public class TestDataNodeMetrics { * and reading causes totalReadTime to move. * @throws Exception */ - @Test(timeout=60000) + @Test(timeout=120000) public void testDataNodeTimeSpend() throws Exception { Configuration conf = new HdfsConfiguration(); - SimulatedFSDataset.setFactory(conf); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build(); try { final FileSystem fs = cluster.getFileSystem(); @@ -283,6 +282,7 @@ public class TestDataNodeMetrics { DFSTestUtil.createFile(fs, new Path("/time.txt." + x.get()), LONG_FILE_LEN, (short) 1, Time.monotonicNow()); DFSTestUtil.readFile(fs, new Path("/time.txt." + x.get())); + fs.delete(new Path("/time.txt." + x.get()), true); } catch (IOException ioe) { LOG.error("Caught IOException while ingesting DN metrics", ioe); return false; @@ -293,7 +293,7 @@ public class TestDataNodeMetrics { return endWriteValue > startWriteValue && endReadValue > startReadValue; } - }, 30, 30000); + }, 30, 60000); } finally { if (cluster != null) { cluster.shutdown();