mirror of https://github.com/apache/lucene.git
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:
parent
977802db0c
commit
14f07def5d
|
@ -27,11 +27,13 @@ import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.lucene.codecs.Codec;
|
||||||
import org.apache.lucene.store.Directory;
|
import org.apache.lucene.store.Directory;
|
||||||
import org.apache.lucene.store.MockDirectoryWrapper;
|
import org.apache.lucene.store.MockDirectoryWrapper;
|
||||||
import org.apache.lucene.util.Constants;
|
import org.apache.lucene.util.Constants;
|
||||||
import org.apache.lucene.util._TestUtil;
|
import org.apache.lucene.util._TestUtil;
|
||||||
|
|
||||||
|
import com.carrotsearch.randomizedtesting.SeedUtils;
|
||||||
/**
|
/**
|
||||||
* Runs TestNRTThreads in a separate process, crashes the JRE in the middle
|
* Runs TestNRTThreads in a separate process, crashes the JRE in the middle
|
||||||
* of execution, then runs checkindex to make sure its not corrupt.
|
* of execution, then runs checkindex to make sure its not corrupt.
|
||||||
|
@ -63,6 +65,9 @@ public class TestIndexWriterOnJRECrash extends TestNRTThreads {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
// we are the fork, setup a crashing thread
|
||||||
final int crashTime = _TestUtil.nextInt(random(), 3000, 4000);
|
final int crashTime = _TestUtil.nextInt(random(), 3000, 4000);
|
||||||
Thread t = new Thread() {
|
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...
|
// 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("-Dtests.nightly=true");
|
||||||
cmd.add("-DtempDir=" + tempDir.getPath());
|
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("-ea");
|
||||||
cmd.add("-cp");
|
cmd.add("-cp");
|
||||||
cmd.add(System.getProperty("java.class.path"));
|
cmd.add(System.getProperty("java.class.path"));
|
||||||
|
|
Loading…
Reference in New Issue