You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by kr...@apache.org on 2023/10/05 16:25:49 UTC
[solr] branch branch_9_4 updated: SOLR-17014: Ensure that injecting random recording flag only happens under randomized context SOLR-16960 (#1983)
This is an automated email from the ASF dual-hosted git repository.
krisden pushed a commit to branch branch_9_4
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9_4 by this push:
new ee474b7db48 SOLR-17014: Ensure that injecting random recording flag only happens under randomized context SOLR-16960 (#1983)
ee474b7db48 is described below
commit ee474b7db483c2242ce1d75074258236ca22103b
Author: Kevin Risden <ri...@users.noreply.github.com>
AuthorDate: Thu Oct 5 12:17:07 2023 -0400
SOLR-17014: Ensure that injecting random recording flag only happens under randomized context SOLR-16960 (#1983)
---
.../src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
index 198d00b6de7..7b45fd6e479 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
@@ -1380,8 +1380,13 @@ public class MiniSolrCloudCluster {
* mechanics.
*/
private static void injectRandomRecordingFlag() {
- boolean isRecording = LuceneTestCase.rarely();
- TraceUtils.IS_RECORDING = (ignored) -> isRecording;
+ try {
+ boolean isRecording = LuceneTestCase.rarely();
+ TraceUtils.IS_RECORDING = (ignored) -> isRecording;
+ } catch (IllegalStateException e) {
+ // This can happen in benchmarks or other places that aren't in a randomized test
+ log.warn("Unable to inject random recording flag due to outside randomized context", e);
+ }
}
private static void resetRecordingFlag() {