lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1204752 - /lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/search/TestRecovery.java
Date Mon, 21 Nov 2011 23:35:24 GMT
Author: yonik
Date: Mon Nov 21 23:35:23 2011
New Revision: 1204752

URL: http://svn.apache.org/viewvc?rev=1204752&view=rev
Log:
more replay tests

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/search/TestRecovery.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/search/TestRecovery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/search/TestRecovery.java?rev=1204752&r1=1204751&r2=1204752&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/search/TestRecovery.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/search/TestRecovery.java
Mon Nov 21 23:35:23 2011
@@ -69,11 +69,10 @@ public class TestRecovery extends SolrTe
       );
 
       h.close();
-
-
       createCore();
 
       // verify that previous close didn't do a commit
+      // recovery should be blocked by our hook
       assertJQ(req("q","id:1") ,"/response/numFound==0");
 
       // unblock recovery
@@ -86,6 +85,30 @@ public class TestRecovery extends SolrTe
           , "/response/numFound==1"
       );
 
+      assertU(adoc("id","2"));
+      assertU(adoc("id","3"));
+      assertU(delI("2"));
+      assertU(adoc("id","4"));
+
+      assertJQ(req("q","*:*") ,"/response/numFound==1");
+
+      h.close();
+      createCore();
+
+      // wait until recovery has finished
+      assertTrue(logReplayFinish.tryAcquire(60, TimeUnit.SECONDS));
+      assertJQ(req("q","*:*") ,"/response/numFound==3");
+      assertJQ(req("q","id:2") ,"/response/numFound==0");
+
+      // no updates, so insure that recovery does not run
+      h.close();
+      int permits = logReplay.availablePermits();
+      createCore();
+      assertJQ(req("q","*:*") ,"/response/numFound==3");
+      Thread.sleep(100);
+      assertEquals(permits, logReplay.availablePermits()); // no updates, so insure that
recovery didn't run
+
+
     } finally {
       FSUpdateLog.testing_logReplayHook = null;
       FSUpdateLog.testing_logReplayFinishHook = null;



Mime
View raw message