lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject lucene-solr:feature/autoscaling: SOLR-10602: Fix usage of delta in NodeAddTriggerTest.testRestoreState to avoid spurious failures
Date Mon, 26 Jun 2017 03:31:10 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/feature/autoscaling 1dd09fc40 -> 82d927f69


SOLR-10602: Fix usage of delta in NodeAddTriggerTest.testRestoreState to avoid spurious failures


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

Branch: refs/heads/feature/autoscaling
Commit: 82d927f699f2ad263567aa620b48ee4bb8385018
Parents: 1dd09fc
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Mon Jun 26 09:01:02 2017 +0530
Committer: Shalin Shekhar Mangar <shalin@apache.org>
Committed: Mon Jun 26 09:01:02 2017 +0530

----------------------------------------------------------------------
 .../apache/solr/cloud/autoscaling/NodeAddedTriggerTest.java   | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/82d927f6/solr/core/src/test/org/apache/solr/cloud/autoscaling/NodeAddedTriggerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/NodeAddedTriggerTest.java
b/solr/core/src/test/org/apache/solr/cloud/autoscaling/NodeAddedTriggerTest.java
index 8e24a00..1a43bd3 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/NodeAddedTriggerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/NodeAddedTriggerTest.java
@@ -232,8 +232,6 @@ public class NodeAddedTriggerTest extends SolrCloudTestCase {
     // add a new node but update the trigger before the waitFor period expires
     // and assert that the new trigger still fires
     NodeAddedTrigger trigger = new NodeAddedTrigger("node_added_trigger", props, container);
-    final long waitTime = 2;
-    props.put("waitFor", waitTime);
     trigger.setListener(noFirstRunListener);
     trigger.run();
 
@@ -258,13 +256,10 @@ public class NodeAddedTriggerTest extends SolrCloudTestCase {
           eventRef.set(event);
           long currentTimeNanos = timeSource.getTime();
           long eventTimeNanos = event.getEventTime();
-          long waitForNanos = TimeUnit.NANOSECONDS.convert(waitTime, TimeUnit.SECONDS) +
WAIT_FOR_DELTA_NANOS;
+          long waitForNanos = TimeUnit.NANOSECONDS.convert(waitForSeconds, TimeUnit.SECONDS)
- WAIT_FOR_DELTA_NANOS;
           if (currentTimeNanos - eventTimeNanos <= waitForNanos) {
             fail("NodeAddedListener was fired before the configured waitFor period: currentTimeNanos="
+ currentTimeNanos + ", eventTimeNanos=" +  eventTimeNanos + ",waitForNanos=" + waitForNanos);
           }
-          if (timeSource.getTime() - event.getEventTime() <= TimeUnit.NANOSECONDS.convert(waitTime,
TimeUnit.SECONDS)) {
-            fail("NodeAddedListener was fired before the configured waitFor period");
-          }
         } else {
           fail("NodeAddedTrigger was fired more than once!");
         }


Mime
View raw message