LUCENE-3992: don't create preflex-rw indexes in the forked jvm, we will think they are corrupt, and use a correct seed format

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1326745 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-04-16 19:03:09 +00:00
parent 977802db0c
commit 14f07def5d
1 changed files with 6 additions and 1 deletions

View File

@ -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 extends TestNRTThreads {
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 extends TestNRTThreads {
// 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"));