dsmiley commented on code in PR #2436:
URL: https://github.com/apache/solr/pull/2436#discussion_r1586786180


##########
solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java:
##########
@@ -140,28 +143,29 @@ 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");
+    String existingPrsDefault = EnvUtils.getProperty(PRS_DEFAULT_PROP);
+    String newPrsDefault;
+    if (target != null && target.isAnnotationPresent(NoPrs.class)) {
+      if (existingPrsDefault != null) {
+        System.setProperty(SAVED_PRS_DEFAULT_PROP, existingPrsDefault);
+      }
+      newPrsDefault = "false";
+    } else if (existingPrsDefault != null) {
+      newPrsDefault = existingPrsDefault;
+    } else {
+      newPrsDefault = Boolean.toString(random().nextBoolean());
     }

Review Comment:
   Can't we instead rely on TestRuleRestoreSystemProperties, thus don't need to 
restore whatever the pre-existing sys prop (set at CLI?) is?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to