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 03:22:27 UTC

(solr) branch jira/prs_disable_test created (now 5b5da3bc547)

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

noble pushed a change to branch jira/prs_disable_test
in repository https://gitbox.apache.org/repos/asf/solr.git


      at 5b5da3bc547 Disable PRS for this testcase to observe if PRS is causing the problem

This branch includes the following new commits:

     new 5b5da3bc547 Disable PRS for this testcase to observe if PRS is causing the problem

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(solr) 01/01: Disable PRS for this testcase to observe if PRS is causing the problem

Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch jira/prs_disable_test
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 5b5da3bc547dc6adea98a53b077cfbdd2a531658
Author: noblepaul <no...@gmail.com>
AuthorDate: Mon Mar 25 14:22:13 2024 +1100

    Disable PRS for this testcase to observe if PRS is causing the problem
---
 .../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 {}
 }