lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject lucene-solr:branch_6x: SOLR-9236: Don't use System.currentTimeMillis.
Date Fri, 08 Jul 2016 00:32:19 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x e91863b8e -> b0386f0d6


SOLR-9236: Don't use System.currentTimeMillis.


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

Branch: refs/heads/branch_6x
Commit: b0386f0d643febdaed32575cccc84eb06af08f5c
Parents: e91863b
Author: markrmiller <markrmiller@apache.org>
Authored: Thu Jul 7 20:31:53 2016 -0400
Committer: markrmiller <markrmiller@apache.org>
Committed: Thu Jul 7 20:32:09 2016 -0400

----------------------------------------------------------------------
 .../org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b0386f0d/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java
b/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java
index a28f559..d7a1fb2 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SharedFSAutoReplicaFailoverTest.java
@@ -314,11 +314,11 @@ public class SharedFSAutoReplicaFailoverTest extends AbstractFullDistribZkTestBa
 
   private void queryAndAssertResultSize(String collection, int expectedResultSize, int timeoutMS)
       throws SolrServerException, IOException, InterruptedException {
-    long startTimestamp = System.currentTimeMillis();
+    long startTimestamp = System.nanoTime();
 
     long actualResultSize = 0;
     while(true) {
-      if (System.currentTimeMillis() - startTimestamp > timeoutMS || actualResultSize
> expectedResultSize) {
+      if (System.nanoTime() - startTimestamp > TimeUnit.MILLISECONDS.toNanos(timeoutMS)
|| actualResultSize > expectedResultSize) {
         fail("expected: " + expectedResultSize + ", actual: " + actualResultSize);
       }
       SolrParams queryAll = new SolrQuery("*:*");


Mime
View raw message