You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by md...@apache.org on 2022/03/11 20:52:28 UTC

[solr] branch main updated: SOLR-16092 Do not fail test on slow CI servers (#738)

This is an automated email from the ASF dual-hosted git repository.

mdrob pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new a63a6fb  SOLR-16092 Do not fail test on slow CI servers (#738)
a63a6fb is described below

commit a63a6fb3091d8b21da453c9caf712882d2664e94
Author: Mike Drob <md...@apache.org>
AuthorDate: Fri Mar 11 14:52:23 2022 -0600

    SOLR-16092 Do not fail test on slow CI servers (#738)
---
 .../apache/solr/cloud/MultiThreadedOCPTest.java    | 27 ++++++++++------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java b/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java
index 0bf58c0..4c386c2 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java
@@ -50,15 +50,7 @@ public class MultiThreadedOCPTest extends AbstractFullDistribZkTestBase {
   }
 
   @Test
-  public void test() throws Exception {
-    testParallelCollectionAPICalls();
-    testTaskExclusivity();
-    testDeduplicationOfSubmittedTasks();
-    testLongAndShortRunningParallelApiCalls();
-    testFillWorkQueue();
-  }
-
-  private void testFillWorkQueue() throws Exception {
+  public void testFillWorkQueue() throws Exception {
     try (SolrClient client = createNewSolrClient("", getBaseUrl((HttpSolrClient) clients.get(0)))) {
       // This test does not make sense when the Collection API execution is distributed. There is no
       // queue to fill
@@ -89,8 +81,9 @@ public class MultiThreadedOCPTest extends AbstractFullDistribZkTestBase {
 
         // Make sure the long running task did not finish, otherwise no way the B_COLL task can be
         // tested to run in parallel with it
-        assertNull(
-            "Long running task finished too early, can't test", checkTaskHasCompleted(client, 2));
+        assumeTrue(
+            "Long running task finished too early, can't test",
+            null == checkTaskHasCompleted(client, 2));
 
         // Enqueue a task on another collection not competing with the lock on A_COLL and see that
         // it can be executed right away
@@ -151,7 +144,8 @@ public class MultiThreadedOCPTest extends AbstractFullDistribZkTestBase {
     return null;
   }
 
-  private void testParallelCollectionAPICalls() throws IOException, SolrServerException {
+  @Test
+  public void testParallelCollectionAPICalls() throws IOException, SolrServerException {
     final int ASYNC_SHIFT = 10000;
     try (SolrClient client = createNewSolrClient("", getBaseUrl((HttpSolrClient) clients.get(0)))) {
       for (int i = 1 + ASYNC_SHIFT; i <= NUM_COLLECTIONS + ASYNC_SHIFT; i++) {
@@ -192,7 +186,8 @@ public class MultiThreadedOCPTest extends AbstractFullDistribZkTestBase {
     }
   }
 
-  private void testTaskExclusivity() throws Exception, SolrServerException {
+  @Test
+  public void testTaskExclusivity() throws Exception, SolrServerException {
     try (SolrClient client = createNewSolrClient("", getBaseUrl((HttpSolrClient) clients.get(0)))) {
 
       Create createCollectionRequest =
@@ -249,7 +244,8 @@ public class MultiThreadedOCPTest extends AbstractFullDistribZkTestBase {
     }
   }
 
-  private void testDeduplicationOfSubmittedTasks() throws IOException, SolrServerException {
+  @Test
+  public void testDeduplicationOfSubmittedTasks() throws IOException, SolrServerException {
     try (SolrClient client = createNewSolrClient("", getBaseUrl((HttpSolrClient) clients.get(0)))) {
       CollectionAdminRequest.createCollection("ocptest_shardsplit2", "conf1", 3, 1)
           .processAsync("3000", client);
@@ -286,7 +282,8 @@ public class MultiThreadedOCPTest extends AbstractFullDistribZkTestBase {
     }
   }
 
-  private void testLongAndShortRunningParallelApiCalls()
+  @Test
+  public void testLongAndShortRunningParallelApiCalls()
       throws InterruptedException, IOException, SolrServerException {
     Thread indexThread =
         new Thread() {