hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject hadoop git commit: HADOOP-14669. GenericTestUtils.waitFor should use monotonic time. Contributed by Daniel Templeton
Date Wed, 19 Jul 2017 14:42:48 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 f806e8627 -> 057631c03


HADOOP-14669. GenericTestUtils.waitFor should use monotonic time. Contributed by Daniel Templeton

(cherry picked from commit df180259b0cc3660e199e85447c7193bee51751c)


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

Branch: refs/heads/branch-2
Commit: 057631c031f40470480ba301d1c346f4a26fa5a5
Parents: f806e86
Author: Jason Lowe <jlowe@yahoo-inc.com>
Authored: Wed Jul 19 09:41:22 2017 -0500
Committer: Jason Lowe <jlowe@yahoo-inc.com>
Committed: Wed Jul 19 09:42:38 2017 -0500

----------------------------------------------------------------------
 .../src/test/java/org/apache/hadoop/test/GenericTestUtils.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/057631c0/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
index 38a0c6c..9291bb0 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
@@ -356,10 +356,10 @@ public abstract class GenericTestUtils {
     Preconditions.checkArgument(waitForMillis >= checkEveryMillis,
         ERROR_INVALID_ARGUMENT);
 
-    long st = Time.now();
+    long st = Time.monotonicNow();
     boolean result = check.get();
 
-    while (!result && (Time.now() - st < waitForMillis)) {
+    while (!result && (Time.monotonicNow() - st < waitForMillis)) {
       Thread.sleep(checkEveryMillis);
       result = check.get();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message