You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2018/04/04 20:06:17 UTC
[2/2] lucene-solr:branch_7x: Moved system.out from the forked
subprocess to test because it uses inherited i/o handles directly and shows
as unexpected JVM output.
Moved system.out from the forked subprocess to test because it uses inherited i/o handles directly and shows as unexpected JVM output.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/94dd6fe9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/94dd6fe9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/94dd6fe9
Branch: refs/heads/branch_7x
Commit: 94dd6fe90b09a5afc8dfc98344a85bd9c90c8450
Parents: 27e5c8d
Author: Dawid Weiss <da...@carrotsearch.com>
Authored: Wed Apr 4 21:54:27 2018 +0200
Committer: Dawid Weiss <da...@carrotsearch.com>
Committed: Wed Apr 4 21:54:50 2018 +0200
----------------------------------------------------------------------
.../apache/lucene/codecs/TestCodecLoadingDeadlock.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/94dd6fe9/lucene/core/src/test/org/apache/lucene/codecs/TestCodecLoadingDeadlock.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/codecs/TestCodecLoadingDeadlock.java b/lucene/core/src/test/org/apache/lucene/codecs/TestCodecLoadingDeadlock.java
index 8137f23..8080c87 100644
--- a/lucene/core/src/test/org/apache/lucene/codecs/TestCodecLoadingDeadlock.java
+++ b/lucene/core/src/test/org/apache/lucene/codecs/TestCodecLoadingDeadlock.java
@@ -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") {