lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1443050 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java
Date Wed, 06 Feb 2013 16:32:05 GMT
Author: yonik
Date: Wed Feb  6 16:32:04 2013
New Revision: 1443050

URL: http://svn.apache.org/viewvc?rev=1443050&view=rev
Log:
tests: make ids more searchable, dump threads on timeout

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

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java?rev=1443050&r1=1443049&r2=1443050&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java
Wed Feb  6 16:32:04 2013
@@ -32,6 +32,8 @@ import org.apache.solr.client.solrj.impl
 import org.apache.solr.client.solrj.impl.HttpSolrServer;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.cloud.ZkStateReader;
+import org.apache.solr.core.Diagnostics;
+import org.apache.solr.update.SolrCmdDistributor;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
@@ -48,10 +50,21 @@ public class ChaosMonkeyNothingIsSafeTes
 
   @BeforeClass
   public static void beforeSuperClass() {
+    SolrCmdDistributor.testing_errorHook = new Diagnostics.Callable() {
+      @Override
+      public void call(Object... data) {
+        SolrCmdDistributor.Request sreq = (SolrCmdDistributor.Request)data[1];
+        if (sreq.exception == null) return;
+        if (sreq.exception.getMessage().contains("Timeout")) {
+          Diagnostics.logThreadDumps("REQUESTING THREAD DUMP DUE TO TIMEOUT: " + sreq.exception.getMessage());
+        }
+      }
+    };
   }
   
   @AfterClass
   public static void afterSuperClass() {
+    SolrCmdDistributor.testing_errorHook = null;
   }
   
   @Before
@@ -102,7 +115,7 @@ public class ChaosMonkeyNothingIsSafeTes
       int i = 0;
       for (i = 0; i < threadCount; i++) {
         StopableIndexingThread indexThread = new StopableIndexingThread(
-            i * 50000, true);
+            (i+1) * 50000, true);
         threads.add(indexThread);
         indexThread.start();
       }
@@ -119,7 +132,7 @@ public class ChaosMonkeyNothingIsSafeTes
       boolean runFullThrottle = random().nextBoolean();
       if (runFullThrottle) {
         FullThrottleStopableIndexingThread ftIndexThread = new FullThrottleStopableIndexingThread(
-            clients, i * 50000, true);
+            clients, (i+1) * 50000, true);
         threads.add(ftIndexThread);
         ftIndexThread.start();
       }



Mime
View raw message