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:
Dawid Weiss 2018-04-04 21:54:27 +02:00
parent ef902f9d8e
commit 469979dc25
1 changed files with 5 additions and 5 deletions

View File

@ -61,8 +61,11 @@ public class TestCodecLoadingDeadlock extends Assert {
.get(rnd.nextInt(avail.size()));
final String dvfName = new ArrayList<>(avail = DocValuesFormat.availableDocValuesFormats())
.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(
Paths.get(System.getProperty("java.home"), "bin", "java").toString(),
"-cp",
@ -86,9 +89,6 @@ public class TestCodecLoadingDeadlock extends Assert {
final String pfName = args[1];
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 CopyOnWriteArrayList<Thread> allThreads = new CopyOnWriteArrayList<>();
final ExecutorService pool = Executors.newFixedThreadPool(numThreads, new NamedThreadFactory("deadlockchecker") {