hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject hadoop git commit: HDFS-9176. Fix TestDirectoryScanner#testThrottling often fails. (Daniel Templeton via lei)
Date Wed, 07 Oct 2015 21:34:43 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 7fbf69bf4 -> 6dd47d754


HDFS-9176. Fix TestDirectoryScanner#testThrottling often fails. (Daniel Templeton via lei)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6dd47d75
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6dd47d75
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6dd47d75

Branch: refs/heads/trunk
Commit: 6dd47d754cb11297c8710a5c318c034abea7a836
Parents: 7fbf69b
Author: Lei Xu <lei@apache.org>
Authored: Wed Oct 7 14:33:43 2015 -0700
Committer: Lei Xu <lei@apache.org>
Committed: Wed Oct 7 14:33:43 2015 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt        |  3 +++
 .../hdfs/server/datanode/TestDirectoryScanner.java | 17 ++++++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6dd47d75/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 33a78f0..c1343e4 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1974,6 +1974,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-9159. [OIV] : return value of the command is not correct if invalid
     value specified in "-p (processor)" option (nijel via vinayakumarb)
 
+    HDFS-9176. Fix TestDirectoryScanner#testThrottling often fails.
+    (Daniel Templeton via lei)
+
 Release 2.7.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6dd47d75/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDirectoryScanner.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDirectoryScanner.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDirectoryScanner.java
index 72c4497..250e07d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDirectoryScanner.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDirectoryScanner.java
@@ -665,17 +665,24 @@ public class TestDirectoryScanner {
           interruptor.schedule(new Runnable() {
             @Override
             public void run() {
-              scanner.shutdown();
               nowMs.set(Time.monotonicNow());
+              scanner.shutdown();
             }
           }, 2L, TimeUnit.SECONDS);
 
           scanner.reconcile();
           assertFalse(scanner.getRunStatus());
-          LOG.info("Scanner took " + (Time.monotonicNow() - nowMs.get())
-              + "ms to shutdown");
-          assertTrue("Scanner took too long to shutdown",
-              Time.monotonicNow() - nowMs.get() < 1000L);
+
+          long finalMs = nowMs.get();
+
+          // If the scan didn't complete before the shutdown was run, check
+          // that the shutdown was timely
+          if (finalMs > 0) {
+            LOG.info("Scanner took " + (Time.monotonicNow() - finalMs)
+                + "ms to shutdown");
+            assertTrue("Scanner took too long to shutdown",
+                Time.monotonicNow() - finalMs < 1000L);
+          }
 
           ratio =
               (float)scanner.timeWaitingMs.get() / scanner.timeRunningMs.get();


Mime
View raw message