Skip to content

Commit

Permalink
Disable PRS for this testcase to observe if PRS is causing the problem (
Browse files Browse the repository at this point in the history
  • Loading branch information
noblepaul authored Mar 25, 2024
1 parent a30c58e commit 59b9930
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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;
Expand All @@ -41,6 +42,7 @@
*/
// 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -134,6 +139,8 @@ public static void shutdownCluster() throws Exception {

@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");
}
Expand All @@ -151,6 +158,8 @@ public void _setPrsDefault() {

@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");
}
Expand Down Expand Up @@ -418,4 +427,12 @@ public static Map<String, String> mapReplicasToReplicaType(DocCollection collect
}
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 {}
}

0 comments on commit 59b9930

Please sign in to comment.