lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [19/27] lucene-solr:jira/http2: SOLR-12801: Harden OverseerTaskQueueTest and DistributedQueueTest.
Date Tue, 11 Dec 2018 20:58:43 GMT
SOLR-12801: Harden OverseerTaskQueueTest and DistributedQueueTest.


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

Branch: refs/heads/jira/http2
Commit: 19d968dc3d9b239657d6efc69f5866fb843bac59
Parents: b9278d7
Author: markrmiller <markrmiller@apache.org>
Authored: Tue Dec 11 08:35:27 2018 -0600
Committer: markrmiller <markrmiller@apache.org>
Committed: Tue Dec 11 08:58:42 2018 -0600

----------------------------------------------------------------------
 .../org/apache/solr/cloud/DistributedQueueTest.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/19d968dc/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java b/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java
index 2a89acd..c67f79e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java
@@ -29,6 +29,8 @@ import org.apache.solr.client.solrj.cloud.DistributedQueue;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.common.util.ExecutorUtil;
 import org.apache.solr.common.util.SolrjNamedThreadFactory;
+import org.apache.solr.common.util.TimeSource;
+import org.apache.solr.util.TimeOut;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -143,6 +145,16 @@ public class DistributedQueueTest extends SolrTestCaseJ4 {
 
     // After draining the queue, a watcher should be set.
     assertNull(dq.peek(100));
+    
+    TimeOut timeout = new TimeOut(30, TimeUnit.SECONDS, TimeSource.NANO_TIME);
+    timeout.waitFor("Timeout waiting to see dirty=false", () -> {
+      try {
+        return !dq.isDirty();
+      } catch (InterruptedException e) {
+        throw new RuntimeException(e);
+      }
+    });
+    
     assertFalse(dq.isDirty());
     assertEquals(1, dq.watcherCount());
 


Mime
View raw message