You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2015/05/28 01:36:17 UTC

svn commit: r1682137 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java

Author: hossman
Date: Wed May 27 23:36:16 2015
New Revision: 1682137

URL: http://svn.apache.org/r1682137
Log:
SOLR-7603: more test verbosity to try and track this down in the future

Modified:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java?rev=1682137&r1=1682136&r2=1682137&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java Wed May 27 23:36:16 2015
@@ -70,6 +70,8 @@ public class UpdateRequestProcessorFacto
   }
 
   public void testUpdateDistribChainSkipping() throws Exception {
+
+    final int EXPECTED_CHAIN_LENGTH = 5;
     SolrCore core = h.getCore();
     for (final String name : Arrays.asList("distrib-chain-explicit",
                                            "distrib-chain-implicit",
@@ -79,8 +81,9 @@ public class UpdateRequestProcessorFacto
       UpdateRequestProcessorChain chain = core.getUpdateProcessingChain(name);
       assertNotNull(name, chain);
 
+      
       // either explicitly, or because of injection
-      assertEquals(name + " chain length", 5,
+      assertEquals(name + " chain length", EXPECTED_CHAIN_LENGTH,
                    chain.getFactories().length);
 
       // Custom comes first in all three of our chains
@@ -92,24 +95,41 @@ public class UpdateRequestProcessorFacto
       // varies depending on chain, but definitely shouldn't be Custom
       proc = chain.createProcessor(req(DISTRIB_UPDATE_PARAM, "non_blank_value"),
                                    new SolrQueryResponse());
+
+      assertNotNull(name + " distrib chain had no proc's in it",
+                    proc);
       assertFalse(name + " post distrib proc should not be a CustomUpdateRequestProcessor: " 
                  + proc.getClass().getName(),
                  proc instanceof CustomUpdateRequestProcessor);
 
       int n=0;
       boolean foundLog = false;
+      String seen = "";
       for (;;) {
         n++;
+        seen = seen + proc.toString() + ", ";
         if (proc instanceof LogUpdateProcessor) {
           foundLog = true;
         }
-        proc = proc.next;
-        if (proc == null) break;
+        if (null == proc.next)  {
+          break;
+        } else {
+          proc = proc.next;
+        }
       }
 
-      assertTrue( n < chain.getFactories().length );   // some processors should have been dropped
-      assertTrue( foundLog );  // make sure the marker interface was successful in keeping the log processor
-
+      // some processors should have been dropped
+      assertTrue(name + " expected a distrib chain shorter then " + EXPECTED_CHAIN_LENGTH + " but got: " + n
+                 + " (" + seen +")",
+                 n < EXPECTED_CHAIN_LENGTH );   
+      // make sure the marker interface was successful in keeping the log processor even though it comes
+      // before distrib
+      assertTrue(name + " expected LogUpdateProcessor in chain due to @RunAllways, but not found: " + seen,
+                 foundLog );  
+
+      // all of these (shortened) distrib chains should still end with RunUpdateprocessor
+      assertTrue(name + " last processor isn't a RunUpdateProcessor: " + proc.getClass().getName(),
+                 proc instanceof RunUpdateProcessor);
     }
 
   }