dsmiley commented on code in PR #2571: URL: https://github.com/apache/solr/pull/2571#discussion_r1688159135
########## solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java: ########## @@ -246,6 +250,51 @@ public void testAliasHandling() throws Exception { 2, client.query(null, paramsWithMixedCollectionAndAlias).getResults().getNumFound()); } + @Test + @LogLevel("org.apache.solr.servlet.HttpSolrCall=INFO") + public void testHttpCspPerf() throws Exception { + + String COLLECTION = "TEST_COLLECTION"; + CollectionAdminRequest.createCollection(COLLECTION, "conf", 2, 1) + .process(cluster.getSolrClient()); + cluster.waitForActiveCollection(COLLECTION, 2, 2); + + SolrInputDocument doc = new SolrInputDocument("id", "1", "title_s", "my doc"); + httpBasedCloudSolrClient.add(COLLECTION, doc); + httpBasedCloudSolrClient.commit(COLLECTION); + + Pattern patternWithCollection = + Pattern.compile( + "path=/admin/collections.*params=\\{[^}]*action=CLUSTERSTATUS[^}]*collection=[^&}]+[^}]*\\}"); + + Pattern patternWithoutCollection = + Pattern.compile( + "path=/admin/collections.*params=\\{[^}]*action=CLUSTERSTATUS(?![^}]*collection=)[^}]*\\}"); + + LogListener entireClusterStateLogs = + LogListener.info(HttpSolrCall.class).regex(patternWithoutCollection); + LogListener collectionClusterStateLogs = + LogListener.info(HttpSolrCall.class).regex(patternWithCollection); + Review Comment: We also want to ensure that _no other HTTP calls are sent_ (except /select). That way if we missed something or if somebody adds something later, that we have this test to ensure that the requests are reasonable. Similarly do for indexing. Similarly do for creating the HttpClient itself... albeit maybe defer that to another JIRA because I think it's fetching the entire cluster status there, which isn't something we should tackle in this PR. -- 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