accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-4602 Improvements to AssignmentThreadsIT
Date Mon, 10 Jul 2017 19:02:37 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 0b7927ba9 -> 2415f22be


ACCUMULO-4602 Improvements to AssignmentThreadsIT


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

Branch: refs/heads/master
Commit: b7d9be0954accdf6ac91cd541f4ed9e60e49f04a
Parents: 9e7e358
Author: Mike Miller <mmiller@apache.org>
Authored: Mon Jul 10 14:05:54 2017 -0400
Committer: Mike Miller <mmiller@apache.org>
Committed: Mon Jul 10 14:05:54 2017 -0400

----------------------------------------------------------------------
 .../accumulo/test/AssignmentThreadsIT.java      | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/b7d9be09/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java b/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java
index 133cabd..3778de6 100644
--- a/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java
@@ -71,23 +71,27 @@ public class AssignmentThreadsIT extends ConfigurableMacIT {
     c.tableOperations().addSplits(tableName, splits);
     log.info("Taking table offline");
     c.tableOperations().offline(tableName, true);
+
     // time how long it takes to load
     log.info("Bringing the table online");
-    long now = System.currentTimeMillis();
+    long now = System.nanoTime();
     c.tableOperations().online(tableName, true);
-    long diff = System.currentTimeMillis() - now;
-    log.info("Loaded " + splits.size() + " tablets in " + diff + " ms");
+    long diff = System.nanoTime() - now;
+
+    log.info("Loaded " + splits.size() + " tablets in " + diff + " ns");
     c.instanceOperations().setProperty(Property.TSERV_ASSIGNMENT_MAXCONCURRENT.getKey(),
"20");
-    now = System.currentTimeMillis();
     log.info("Taking table offline, again");
     c.tableOperations().offline(tableName, true);
     // wait >10 seconds for thread pool to update
-    UtilWaitThread.sleep(Math.max(0, now + 11 * 1000 - System.currentTimeMillis()));
-    now = System.currentTimeMillis();
+    log.info("sleep for {} ms so thread pool can update", 60_000);
+    UtilWaitThread.sleep(60_000);
+
     log.info("Bringing table back online");
+    now = System.nanoTime();
     c.tableOperations().online(tableName, true);
-    long diff2 = System.currentTimeMillis() - now;
-    log.debug("Loaded " + splits.size() + " tablets in " + diff2 + " ms");
+    long diff2 = System.nanoTime() - now;
+
+    log.debug("Loaded " + splits.size() + " tablets in " + diff2 + " ns");
     assertTrue(diff2 < diff);
   }
 


Mime
View raw message