tests: enable chaos safe leader test

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1442648 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2013-02-05 16:27:09 +00:00
parent 0eb56551b9
commit fec620505b
1 changed files with 13 additions and 3 deletions

View File

@ -24,16 +24,17 @@ import org.apache.lucene.util.LuceneTestCase.BadApple;
import org.apache.lucene.util.LuceneTestCase.Slow; import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.Diagnostics;
import org.apache.solr.core.SolrCore; import org.apache.solr.core.SolrCore;
import org.apache.solr.servlet.SolrDispatchFilter; import org.apache.solr.servlet.SolrDispatchFilter;
import org.apache.solr.update.DirectUpdateHandler2; import org.apache.solr.update.DirectUpdateHandler2;
import org.apache.solr.update.SolrCmdDistributor;
import org.junit.After; import org.junit.After;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
@Slow @Slow
@BadApple
public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase { public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase {
private static final int BASE_RUN_LENGTH = 120000; private static final int BASE_RUN_LENGTH = 120000;
@ -41,12 +42,21 @@ public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase {
@BeforeClass @BeforeClass
public static void beforeSuperClass() { 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 @AfterClass
public static void afterSuperClass() { public static void afterSuperClass() {
SolrCmdDistributor.testing_errorHook = null;
} }
@Before @Before