You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by no...@apache.org on 2024/03/25 15:03:32 UTC

(solr) branch main updated: Disable PRS for this testcase to observe if PRS is causing the problem (#2372)

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

noble 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 59b9930d48c Disable PRS for this testcase to observe if PRS is causing the problem (#2372)
59b9930d48c is described below

commit 59b9930d48c5a728878ab4f1f9f0c6db20eb3fa6
Author: Noble Paul <no...@users.noreply.github.com>
AuthorDate: Tue Mar 26 02:03:27 2024 +1100

    Disable PRS for this testcase to observe if PRS is causing the problem (#2372)
---
 .../api/collections/TestLocalFSCloudBackupRestore.java  |  2 ++
 .../java/org/apache/solr/cloud/SolrCloudTestCase.java   | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestLocalFSCloudBackupRestore.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestLocalFSCloudBackupRestore.java
index baf657f553b..38a18d78543 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestLocalFSCloudBackupRestore.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestLocalFSCloudBackupRestore.java
@@ -27,6 +27,7 @@ import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.cloud.MiniSolrCloudCluster;
+import org.apache.solr.cloud.SolrCloudTestCase;
 import org.apache.solr.cloud.ZkConfigSetService;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
@@ -41,6 +42,7 @@ import org.junit.Test;
  */
 // Backups do checksum validation against a footer value not present in 'SimpleText'
 @LuceneTestCase.SuppressCodecs({"SimpleText"})
+@SolrCloudTestCase.NoPrs // disabled PRS for a while to enure if that is causing test failures
 public class TestLocalFSCloudBackupRestore extends AbstractCloudBackupRestoreTestCase {
   private static String backupLocation;
 
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java b/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java
index d9ad101c121..7010666edbd 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java
@@ -17,7 +17,12 @@
 
 package org.apache.solr.cloud;
 
+import com.carrotsearch.randomizedtesting.RandomizedTest;
 import java.io.IOException;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -134,6 +139,8 @@ public class SolrCloudTestCase extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void setPrsDefault() {
+    Class<?> target = RandomizedTest.getContext().getTargetClass();
+    if (target != null && target.isAnnotationPresent(NoPrs.class)) return;
     if (isPRS()) {
       System.setProperty("solr.prs.default", "true");
     }
@@ -151,6 +158,8 @@ public class SolrCloudTestCase extends SolrTestCaseJ4 {
 
   @AfterClass
   public static void unsetPrsDefault() {
+    Class<?> target = RandomizedTest.getContext().getTargetClass();
+    if (target != null && target.isAnnotationPresent(NoPrs.class)) return;
     if (isPRS()) {
       System.clearProperty("solr.prs.default");
     }
@@ -418,4 +427,12 @@ public class SolrCloudTestCase extends SolrTestCaseJ4 {
     }
     return replicaTypeMap;
   }
+
+  /**
+   * A marker interface to Ignore PRS in tests. This is for debugging purposes to ensure that PRS is
+   * causing test failures
+   */
+  @Retention(RetentionPolicy.RUNTIME)
+  @Target(ElementType.TYPE)
+  public @interface NoPrs {}
 }