This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new e0074321842 SOLR-18024 Flaky test
CloudHttp2SolrClientTest.testHttpCspPerf (#3938)
e0074321842 is described below
commit e0074321842a3c1ecaf51cff05eab8c1153cea86
Author: Jan Høydahl <[email protected]>
AuthorDate: Tue Dec 16 11:33:04 2025 +0100
SOLR-18024 Flaky test CloudHttp2SolrClientTest.testHttpCspPerf (#3938)
Co-authored-by: David Smiley <[email protected]>
(cherry picked from commit 5201ea82f9e00f92cb69465f22868bff484ee7ed)
---
.../solr/client/solrj/impl/CloudHttp2SolrClientTest.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
index dc09842be89..794874a5f19 100644
---
a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
+++
b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
@@ -96,6 +96,10 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
@BeforeClass
public static void setupCluster() throws Exception {
System.setProperty("metricsEnabled", "true");
+ // BaseHttpClusterStateProvider has a background job that pre-fetches data
from CLUSTERSTATUS
+ // on timed intervals. This can pollute this test, so we set the interval
very high to
+ // prevent it from running.
+ System.setProperty(SYS_PROP_CACHE_TIMEOUT_SECONDS, "" + Integer.MAX_VALUE);
configureCluster(NODE_COUNT)
.addConfig(
"conf",
@@ -258,14 +262,9 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
// admin endpoint. Too many calls to CLUSTERSTATUS might mean insufficient
caching and
// performance regressions!
- // BaseHttpClusterStateProvider has a background job that pre-fetches data
from CLUSTERSTATUS
- // on timed intervals. This can pollute this test, so we set the interval
very high to
- // prevent it from running.
- System.setProperty(SYS_PROP_CACHE_TIMEOUT_SECONDS, "" + Integer.MAX_VALUE);
-
String collectionName = "HTTPCSPTEST";
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 1)
- .process(cluster.getSolrClient());
+ .process(getRandomClient());
cluster.waitForActiveCollection(collectionName, 2, 2);
try (LogListener adminLogs =
LogListener.info(HttpSolrCall.class).substring("[admin]");
@@ -304,6 +303,9 @@ public class CloudHttp2SolrClientTest extends
SolrCloudTestCase {
assertEquals(2, adminLogs.getCount());
}
}
+
+ // Clean up the collection to allow test iterations to succeed
+
CollectionAdminRequest.deleteCollection(collectionName).process(getRandomClient());
}
private CloudSolrClient createHttpCSPBasedCloudSolrClient() {