mirror of https://github.com/apache/lucene.git
Moved system.out from the forked subprocess to test because it uses inherited i/o handles directly and shows as unexpected JVM output.
This commit is contained in:
parent
ef902f9d8e
commit
469979dc25
|
@ -62,7 +62,10 @@ public class TestCodecLoadingDeadlock extends Assert {
|
||||||
final String dvfName = new ArrayList<>(avail = DocValuesFormat.availableDocValuesFormats())
|
final String dvfName = new ArrayList<>(avail = DocValuesFormat.availableDocValuesFormats())
|
||||||
.get(rnd.nextInt(avail.size()));
|
.get(rnd.nextInt(avail.size()));
|
||||||
|
|
||||||
// spawn separate JVM:
|
System.out.println(String.format(Locale.ROOT,
|
||||||
|
"codec: %s, pf: %s, dvf: %s", codecName, pfName, dvfName));
|
||||||
|
|
||||||
|
// Fork a separate JVM to reinitialize classes.
|
||||||
final Process p = new ProcessBuilder(
|
final Process p = new ProcessBuilder(
|
||||||
Paths.get(System.getProperty("java.home"), "bin", "java").toString(),
|
Paths.get(System.getProperty("java.home"), "bin", "java").toString(),
|
||||||
"-cp",
|
"-cp",
|
||||||
|
@ -86,9 +89,6 @@ public class TestCodecLoadingDeadlock extends Assert {
|
||||||
final String pfName = args[1];
|
final String pfName = args[1];
|
||||||
final String dvfName = args[2];
|
final String dvfName = args[2];
|
||||||
|
|
||||||
System.out.println(String.format(Locale.ROOT,
|
|
||||||
"codec: %s, pf: %s, dvf: %s", codecName, pfName, dvfName));
|
|
||||||
|
|
||||||
final int numThreads = 14; // two times the modulo in switch statement below
|
final int numThreads = 14; // two times the modulo in switch statement below
|
||||||
final CopyOnWriteArrayList<Thread> allThreads = new CopyOnWriteArrayList<>();
|
final CopyOnWriteArrayList<Thread> allThreads = new CopyOnWriteArrayList<>();
|
||||||
final ExecutorService pool = Executors.newFixedThreadPool(numThreads, new NamedThreadFactory("deadlockchecker") {
|
final ExecutorService pool = Executors.newFixedThreadPool(numThreads, new NamedThreadFactory("deadlockchecker") {
|
||||||
|
|
Loading…
Reference in New Issue