epugh commented on code in PR #1256: URL: https://github.com/apache/solr/pull/1256#discussion_r1148552968
########## solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java: ########## @@ -182,17 +184,32 @@ public void testReplicasInLowerTerms() throws Exception { assertEquals( "Expected only 2 documents in the index", 2, - cloudClient.query(params).getResults().getNumFound()); + cloudClient.query(DEFAULT_COLLECTION, params).getResults().getNumFound()); } - bringBackOldLeaderAndSendDoc(testCollectionName, leader, notLeaders, 5); + bringBackOldLeaderAndSendDoc(DEFAULT_COLLECTION, leader, notLeaders, 5); } finally { log.info("Cleaning up after the test."); // try to clean up - attemptCollectionDelete(cloudClient, testCollectionName); + attemptCollectionDelete(cloudClient, DEFAULT_COLLECTION); } } + /** + * For this test, we need a cloudClient that is not randomized since we need to NEVER send the + * updates only to the leader. The way the RandomizingCloudSolrClientBuilder works, you can't + * avoid its internal decision-making process to sometimes send updates only to leaders. + */ + @Override + protected CloudSolrClient createCloudClient(String defaultCollection) { + CloudLegacySolrClient.Builder builder = + new CloudLegacySolrClient.Builder( + Collections.singletonList(zkServer.getZkAddress()), Optional.empty()); + defaultCollection = DEFAULT_COLLECTION; Review Comment: okay, rewrote the docs a bit to highlight the why, and made it clearer we are only using DEFAULT_COLLECTION.... -- 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