lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1574273 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java
Date Wed, 05 Mar 2014 01:01:18 GMT
Author: hossman
Date: Wed Mar  5 01:01:18 2014
New Revision: 1574273

URL: http://svn.apache.org/r1574273
Log:
SOLR-5815: add some test logging to try and figure out WTF

Modified:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java?rev=1574273&r1=1574272&r2=1574273&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestNonNRTOpen.java Wed Mar 
5 01:01:18 2014
@@ -30,8 +30,12 @@ import org.apache.solr.util.RefCounted;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class TestNonNRTOpen extends SolrTestCaseJ4 {
-  
+  private static final Logger log = LoggerFactory.getLogger(TestNonNRTOpen.class);
+
   @BeforeClass
   public static void beforeClass() throws Exception {
     // use a filesystem, because we need to create an index, then "start up solr"
@@ -80,6 +84,7 @@ public class TestNonNRTOpen extends Solr
     
     // core reload
     String core = h.getCore().getName();
+    log.info("Reloading core: " + h.getCore().toString());
     h.getCoreContainer().reload(core);
     assertNotNRT(1);
     
@@ -90,6 +95,7 @@ public class TestNonNRTOpen extends Solr
     
     // add a doc and core reload
     assertU(adoc("bazz", "doc2"));
+    log.info("Reloading core: " + h.getCore().toString());
     h.getCoreContainer().reload(core);
     assertNotNRT(3);
   }
@@ -127,11 +133,15 @@ public class TestNonNRTOpen extends Solr
   }
   
   static void assertNotNRT(int maxDoc) {
-    RefCounted<SolrIndexSearcher> searcher = h.getCore().getSearcher();
+    SolrCore core = h.getCore();
+    log.info("Checking notNRT & maxDoc=" + maxDoc + " of core=" + core.toString());
+    RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
     try {
-      DirectoryReader ir = searcher.get().getIndexReader();
-      assertEquals(maxDoc, ir.maxDoc());
-      assertFalse("expected non-NRT reader, got: " + ir, ir.toString().contains(":nrt"));
+      SolrIndexSearcher s = searcher.get();
+      DirectoryReader ir = s.getIndexReader();
+      assertEquals("SOLR-5815? : wrong maxDoc: core=" + core.toString() +" searcher=" + s.toString(),
+                   maxDoc, ir.maxDoc());
+      assertFalse("SOLR-5815? : expected non-NRT reader, got: " + ir, ir.toString().contains(":nrt"));
     } finally {
       searcher.decref();
     }



Mime
View raw message