lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [34/50] [abbrv] lucene-solr:jira/solr-9858: SOLR-10207: Harden CleanupOldIndexTest.
Date Wed, 01 Mar 2017 09:27:42 GMT
SOLR-10207: Harden CleanupOldIndexTest.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ed0f0f45
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ed0f0f45
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ed0f0f45

Branch: refs/heads/jira/solr-9858
Commit: ed0f0f45ce17e2218ec2e97aab2fcb1a0d4defa6
Parents: 86b5b63
Author: markrmiller <markrmiller@apache.org>
Authored: Mon Feb 27 22:55:10 2017 -0500
Committer: markrmiller <markrmiller@apache.org>
Committed: Mon Feb 27 23:33:47 2017 -0500

----------------------------------------------------------------------
 .../apache/solr/cloud/CleanupOldIndexTest.java    | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ed0f0f45/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java b/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java
index 006c3c9..cc03a25 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java
@@ -30,6 +30,7 @@ import org.apache.solr.common.cloud.DocCollection;
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.handler.SnapShooter;
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -44,6 +45,15 @@ public class CleanupOldIndexTest extends SolrCloudTestCase {
         .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-dynamic").resolve("conf"))
         .configure();
   }
+  
+  @AfterClass
+  public static void teardownTestCases() throws Exception {
+
+    if (suiteFailureMarker.wasSuccessful()) {
+      zkClient().printLayoutToStdOut();
+    }
+
+  }
 
   private static final String COLLECTION = "oldindextest";
 
@@ -54,14 +64,14 @@ public class CleanupOldIndexTest extends SolrCloudTestCase {
         .processAndWait(cluster.getSolrClient(), DEFAULT_TIMEOUT);
     cluster.getSolrClient().setDefaultCollection(COLLECTION); // TODO make this configurable
on StoppableIndexingThread
 
-    int[] maxDocList = new int[] {300, 700, 1200};
+    int[] maxDocList = new int[] {300, 500, 700};
     int maxDoc = maxDocList[random().nextInt(maxDocList.length - 1)];
 
     StoppableIndexingThread indexThread = new StoppableIndexingThread(null, cluster.getSolrClient(),
"1", true, maxDoc, 1, true);
     indexThread.start();
 
     // give some time to index...
-    int[] waitTimes = new int[] {200, 2000, 3000};
+    int[] waitTimes = new int[] {3000, 4000};
     Thread.sleep(waitTimes[random().nextInt(waitTimes.length - 1)]);
 
     // create some "old" index directories
@@ -86,13 +96,13 @@ public class CleanupOldIndexTest extends SolrCloudTestCase {
     assertTrue(oldIndexDir2.isDirectory());
 
     // bring shard replica down
-    jetty.stop();
+    ChaosMonkey.stop(jetty);
 
     // wait a moment - lets allow some docs to be indexed so replication time is non 0
     Thread.sleep(waitTimes[random().nextInt(waitTimes.length - 1)]);
 
     // bring shard replica up
-    jetty.start();
+    ChaosMonkey.start(jetty);
 
     // make sure replication can start
     Thread.sleep(3000);


Mime
View raw message