From 688c8d285f46340b507f8767e49f57845744f7f5 Mon Sep 17 00:00:00 2001 From: David Smiley Date: Wed, 1 May 2019 14:30:35 -0400 Subject: [PATCH] SOLR-12833: Test should use ExecutorUtil (cherry picked from commit 1f91932ba45d92c0ccedbdb2a24a57cc77808fae) --- .../processor/DistributedUpdateProcessorTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/update/processor/DistributedUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/DistributedUpdateProcessorTest.java index 33820ac987c..c141177c39c 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/DistributedUpdateProcessorTest.java +++ b/solr/core/src/test/org/apache/solr/update/processor/DistributedUpdateProcessorTest.java @@ -17,23 +17,19 @@ package org.apache.solr.update.processor; -import static org.hamcrest.CoreMatchers.is; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.Mockito.doReturn; - import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.function.Function; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.params.ModifiableSolrParams; +import org.apache.solr.common.util.ExecutorUtil; import org.apache.solr.request.LocalSolrQueryRequest; import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.update.AddUpdateCommand; @@ -49,6 +45,10 @@ import org.mockito.Mockito; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; +import static org.hamcrest.CoreMatchers.is; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.Mockito.doReturn; + public class DistributedUpdateProcessorTest extends SolrTestCaseJ4 { @Rule @@ -57,10 +57,10 @@ public class DistributedUpdateProcessorTest extends SolrTestCaseJ4 { @BeforeClass public static void beforeClass() throws Exception { - executor = Executors.newCachedThreadPool(); + executor = ExecutorUtil.newMDCAwareCachedThreadPool(getClassName()); initCore("solr/collection1/conf/solrconfig.xml","solr/collection1/conf/schema-minimal-with-another-uniqkey.xml"); } - + @AfterClass public static void AfterClass() { executor.shutdown();