Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-10636 Increase randomness of metric names to avoid conflicts with non-test scopes.

Andrzej Bialecki69783f6403b0
diff --git a/solr/core/src/test/org/apache/solr/metrics/SolrMetricTestUtils.java b/solr/core/src/test/org/apache/solr/metrics/SolrMetricTestUtils.java
index 98fc9b1c810..c506c1dfc71 100644
--- a/solr/core/src/test/org/apache/solr/metrics/SolrMetricTestUtils.java
+++ b/solr/core/src/test/org/apache/solr/metrics/SolrMetricTestUtils.java
@@ -35,7 +35,7 @@ public final class SolrMetricTestUtils {
}
public static String getRandomScope(Random random, boolean shouldDefineScope) {
- return shouldDefineScope ? TestUtil.randomSimpleString(random, 1, 10) : null; // must be simple string for JMX publishing
+ return shouldDefineScope ? TestUtil.randomSimpleString(random, 5, 10) : null; // must be simple string for JMX publishing
}
public static SolrInfoBean.Category getRandomCategory(Random random) {
@@ -65,7 +65,7 @@ public final class SolrMetricTestUtils {
boolean shouldReplaceMetric = !existing.isEmpty() && random.nextBoolean();
String name = shouldReplaceMetric
? existingKeys.get(TestUtil.nextInt(random, 0, existingKeys.size() - 1))
- : TestUtil.randomSimpleString(random, 1, 10) + SUFFIX; // must be simple string for JMX publishing
+ : TestUtil.randomSimpleString(random, 5, 10) + SUFFIX; // must be simple string for JMX publishing
Counter counter = new Counter();
counter.inc(random.nextLong());