You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/04/16 21:03:10 UTC

svn commit: r1326745 - /lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java

Author: rmuir
Date: Mon Apr 16 19:03:09 2012
New Revision: 1326745

URL: http://svn.apache.org/viewvc?rev=1326745&view=rev
Log:
LUCENE-3992: don't create preflex-rw indexes in the forked jvm, we will think they are corrupt, and use a correct seed format

Modified:
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java?rev=1326745&r1=1326744&r2=1326745&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java Mon Apr 16 19:03:09 2012
@@ -27,11 +27,13 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.Constants;
 import org.apache.lucene.util._TestUtil;
 
+import com.carrotsearch.randomizedtesting.SeedUtils;
 /**
  * Runs TestNRTThreads in a separate process, crashes the JRE in the middle
  * of execution, then runs checkindex to make sure its not corrupt.
@@ -63,6 +65,9 @@ public class TestIndexWriterOnJRECrash e
           return;
       }
     } else {
+      // TODO: the non-fork code could simply enable impersonation?
+      assumeFalse("does not support PreFlex, see LUCENE-3992", 
+          Codec.getDefault().getName().equals("Lucene3x"));
       // we are the fork, setup a crashing thread
       final int crashTime = _TestUtil.nextInt(random(), 3000, 4000);
       Thread t = new Thread() {
@@ -96,7 +101,7 @@ public class TestIndexWriterOnJRECrash e
     // passing NIGHTLY to this test makes it run for much longer, easier to catch it in the act...
     cmd.add("-Dtests.nightly=true");
     cmd.add("-DtempDir=" + tempDir.getPath());
-    cmd.add("-Dtests.seed=" + random().nextLong() + ":" + random().nextLong());
+    cmd.add("-Dtests.seed=" + SeedUtils.formatSeed(random().nextLong()));
     cmd.add("-ea");
     cmd.add("-cp");
     cmd.add(System.getProperty("java.class.path"));