From c5803cabf5e60c1f639d7efbb0e41f85183182a6 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Sun, 13 Oct 2013 22:45:25 +0000 Subject: [PATCH] SOLR-5345: A first pass toning down OpenCloseCoreStressTest git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1531766 13f79535-47bb-0310-9956-ffa450edef68 --- .../solr/core/OpenCloseCoreStressTest.java | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java b/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java index 3db0f61a08e..fff181ed1f4 100644 --- a/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java +++ b/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java @@ -52,14 +52,14 @@ public class OpenCloseCoreStressTest extends SolrTestCaseJ4 { private final Object locker = new Object(); - private int numCores = 20; + private int numCores = TEST_NIGHTLY ? 7 : 5; private Map coreCounts; private List coreNames; static final int COMMIT_WITHIN = 5000; - final int indexingThreads = 15; - final int queryThreads = 15; + final int indexingThreads = TEST_NIGHTLY ? 9 : 5; + final int queryThreads = TEST_NIGHTLY ? 9 : 5; final int resetInterval = 30 * 60; // minutes to report then delete everything long cumulativeDocs = 0; @@ -75,22 +75,6 @@ public class OpenCloseCoreStressTest extends SolrTestCaseJ4 { static String savedFactory; - // Keep the indexes from being randomly generated. - @BeforeClass - public static void beforeClass() { - savedFactory = System.getProperty("solr.DirectoryFactory"); - System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockFSDirectoryFactory"); - } - - @AfterClass - public static void afterClass() { - if (savedFactory == null) { - System.clearProperty("solr.directoryFactory"); - } else { - System.setProperty("solr.directoryFactory", savedFactory); - } - } - @Before public void setupServer() throws Exception { coreCounts = new TreeMap(); @@ -98,7 +82,7 @@ public class OpenCloseCoreStressTest extends SolrTestCaseJ4 { cumulativeDocs = 0; solrHomeDirectory = new File(TEMP_DIR, "OpenCloseCoreStressTest_"); - FileUtils.deleteDirectory(solrHomeDirectory); // Insure that a failed test didn't leave something lying around. + FileUtils.deleteDirectory(solrHomeDirectory); // Ensure that a failed test didn't leave something lying around. jetty = new JettySolrRunner(solrHomeDirectory.getAbsolutePath(), "/solr", 0); } @@ -111,14 +95,14 @@ public class OpenCloseCoreStressTest extends SolrTestCaseJ4 { @Test @Slow - public void test30SecondsOld() throws Exception { - doStress(30, true); + public void test15SecondsOld() throws Exception { + doStress(15, true); } @Test @Slow - public void test30SecondsNew() throws Exception { - doStress(30, false); + public void test15SecondsNew() throws Exception { + doStress(15, false); } @Test