From ab903029a9d353677184ff5602966b11ffb408b9 Mon Sep 17 00:00:00 2001 From: Walter Su Date: Mon, 18 Apr 2016 20:29:29 +0800 Subject: [PATCH] HDFS-10275. TestDataNodeMetrics failing intermittently due to TotalWriteTime counted incorrectly. Contributed by Lin Yiqun. --- .../hadoop/hdfs/server/datanode/TestDataNodeMetrics.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 5f9b60267c..355f7a1e75 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 @@ -258,10 +258,9 @@ public void testTimeoutMetric() throws Exception { * 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(); @@ -284,6 +283,7 @@ public Boolean get() { 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; @@ -294,7 +294,7 @@ public Boolean get() { return endWriteValue > startWriteValue && endReadValue > startReadValue; } - }, 30, 30000); + }, 30, 60000); } finally { if (cluster != null) { cluster.shutdown();