lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1682138 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
Date Wed, 27 May 2015 23:39:19 GMT
Author: hossman
Date: Wed May 27 23:39:19 2015
New Revision: 1682138

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

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java?rev=1682138&r1=1682137&r2=1682138&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
Wed May 27 23:39:19 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);
     }
 
   }



Mime
View raw message