diff --git a/dev-tools/eclipse/dot.classpath b/dev-tools/eclipse/dot.classpath
index 322371e..22e5a9e 100644
--- a/dev-tools/eclipse/dot.classpath
+++ b/dev-tools/eclipse/dot.classpath
@@ -174,6 +174,6 @@
-
+
diff --git a/dev-tools/idea/.idea/libraries/JUnit.xml b/dev-tools/idea/.idea/libraries/JUnit.xml
index b3a42f8..53c0f8a 100644
--- a/dev-tools/idea/.idea/libraries/JUnit.xml
+++ b/dev-tools/idea/.idea/libraries/JUnit.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/dev-tools/maven/pom.xml.template b/dev-tools/maven/pom.xml.template
index 4d4f233..19282ba 100644
--- a/dev-tools/maven/pom.xml.template
+++ b/dev-tools/maven/pom.xml.template
@@ -388,7 +388,7 @@
com.carrotsearch.randomizedtesting
randomizedtesting-runner
- 1.6.0
+ 2.0.0.rc1
diff --git a/lucene/build.xml b/lucene/build.xml
index 81e6bde..568b416 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -177,6 +177,7 @@
+
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 4493b7f..77b9d09 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -88,7 +88,7 @@
-
+
diff --git a/lucene/core/src/test/org/apache/lucene/TestWorstCaseTestBehavior.java b/lucene/core/src/test/org/apache/lucene/TestWorstCaseTestBehavior.java
new file mode 100644
index 0000000..c86f813
--- /dev/null
+++ b/lucene/core/src/test/org/apache/lucene/TestWorstCaseTestBehavior.java
@@ -0,0 +1,74 @@
+package org.apache.lucene;
+
+import org.apache.lucene.util.LuceneTestCase;
+import org.junit.Ignore;
+
+import com.carrotsearch.randomizedtesting.annotations.Timeout;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class TestWorstCaseTestBehavior extends LuceneTestCase {
+ @Ignore
+ public void testThreadLeak() {
+ Thread t = new Thread() {
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ // Ignore.
+ }
+ }
+ };
+ t.start();
+
+ while (!t.isAlive()) {
+ Thread.yield();
+ }
+
+ // once alive, leave it to run outside of the test scope.
+ }
+
+ @Ignore
+ public void testUncaughtException() throws Exception {
+ Thread t = new Thread() {
+ @Override
+ public void run() {
+ throw new RuntimeException("foobar");
+ }
+ };
+ t.start();
+ t.join();
+ }
+
+ @Ignore
+ @Timeout(millis = 500)
+ public void testTimeout() throws Exception {
+ Thread.sleep(5000);
+ }
+
+ @Ignore
+ @Timeout(millis = 1000)
+ public void testZombie() throws Exception {
+ while (true) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {}
+ }
+ }
+}
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java
index e24ba4b..135fea4 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java
@@ -27,12 +27,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.ThreadInterruptedException;
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeaks;
-
/**
* Tests for {@link DocumentsWriterStallControl}
*/
-@ThreadLeaks(failTestIfLeaking = true)
public class TestDocumentsWriterStallControl extends LuceneTestCase {
public void testSimpleStall() throws InterruptedException {
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSort.java b/lucene/core/src/test/org/apache/lucene/search/TestSort.java
index cd4d901..45cb670 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSort.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSort.java
@@ -59,6 +59,7 @@ import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.DocIdBitSet;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.NamedThreadFactory;
import org.apache.lucene.util._TestUtil;
import org.junit.BeforeClass;
@@ -810,7 +811,7 @@ public class TestSort extends LuceneTestCase {
assertMatches (full, queryG, sort, "ZYXW");
// Do the same for a ParallelMultiSearcher
- ExecutorService exec = Executors.newFixedThreadPool(_TestUtil.nextInt(random(), 2, 8));
+ ExecutorService exec = Executors.newFixedThreadPool(_TestUtil.nextInt(random(), 2, 8), new NamedThreadFactory("testEmptyFieldSort"));
IndexSearcher parallelSearcher=new IndexSearcher (full.getIndexReader(), exec);
sort.setSort (new SortField ("int", SortField.Type.INT),
@@ -852,7 +853,7 @@ public class TestSort extends LuceneTestCase {
// test a variety of sorts using a parallel multisearcher
public void testParallelMultiSort() throws Exception {
- ExecutorService exec = Executors.newFixedThreadPool(_TestUtil.nextInt(random(), 2, 8));
+ ExecutorService exec = Executors.newFixedThreadPool(_TestUtil.nextInt(random(), 2, 8), new NamedThreadFactory("testParallelMultiSort"));
IndexSearcher searcher = new IndexSearcher(
new MultiReader(searchX.getIndexReader(),
searchY.getIndexReader()), exec);
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java b/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
index 37cc86c..b5e36e9 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
@@ -159,7 +159,7 @@ public class TestWeakIdentityMap extends LuceneTestCase {
public void testConcurrentHashMap() throws Exception {
// don't make threadCount and keyCount random, otherwise easily OOMs or fails otherwise:
final int threadCount = 8, keyCount = 1024;
- final ExecutorService exec = Executors.newFixedThreadPool(threadCount);
+ final ExecutorService exec = Executors.newFixedThreadPool(threadCount, new NamedThreadFactory("testConcurrentHashMap"));
final WeakIdentityMap