SOLR-10050 Fix SolrMetricManagerTest.testClearMetrics() failures.

This commit is contained in:
Andrzej Bialecki 2017-01-30 13:16:44 +01:00
parent bb9b423cec
commit f73d93ac1b
2 changed files with 4 additions and 4 deletions

View File

@ -143,13 +143,13 @@ public class SolrMetricManagerTest extends SolrTestCaseJ4 {
assertEquals(metrics.size() * 3, metricManager.registry(registryName).getMetrics().size());
// clear "foo.bar"
Set<String> removed = metricManager.clearMetrics(registryName, "foo", "bar");
// clear all metrics with prefix "foo.bar."
Set<String> removed = metricManager.clearMetrics(registryName, "foo", "bar.");
assertEquals(metrics.size(), removed.size());
for (String s : removed) {
assertTrue(s.startsWith("foo.bar."));
}
removed = metricManager.clearMetrics(registryName, "foo", "baz");
removed = metricManager.clearMetrics(registryName, "foo", "baz.");
assertEquals(metrics.size(), removed.size());
for (String s : removed) {
assertTrue(s.startsWith("foo.baz."));

View File

@ -63,7 +63,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
assertTrue(metrics.entrySet().stream().filter(e -> e.getKey().startsWith("INDEX")).count() >= 12);
// this is variable, depending on the codec and the number of created files
assertTrue(metrics.entrySet().stream().filter(e -> e.getKey().startsWith("DIRECTORY")).count() > 50);
assertTrue(metrics.entrySet().stream().filter(e -> e.getKey().startsWith("DIRECTORY")).count() > 20);
// check basic index meters
Timer timer = (Timer)metrics.get("INDEX.merge.minor");