risdenk commented on code in PR #1496: URL: https://github.com/apache/solr/pull/1496#discussion_r1151109774
########## solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java: ########## @@ -147,6 +148,7 @@ public class TestRandomFlRTGCloud extends SolrCloudTestCase { new NotIncludedValidator("score", "score_alias:score")); @BeforeClass + @SuppressWarnings({"rawtypes", "unchecked"}) Review Comment: why? ########## solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java: ########## @@ -509,13 +523,10 @@ private void assertRTG(final SolrInputDocument[] knownDocs, final int[] docIds) } String wt = params.get(CommonParams.WT, "javabin"); - final ResponseParser restoreResponseParser; - if (client instanceof HttpSolrClient) { - restoreResponseParser = modifyParser((HttpSolrClient) client, wt); - } else { - // unless HttpSolrClient, `wt` doesn't matter -- it'll always be binary. + final SolrClient client = getRandomClient(random(), wt); + // unless HttpSolrClient, `wt` doesn't matter -- it'll always be binary. + if (client instanceof CloudSolrClient) { wt = "javabin"; - restoreResponseParser = null; } Review Comment: I don't understand why this is necessary... ########## solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java: ########## @@ -635,12 +644,36 @@ private static SolrDocumentList getDocsFromXmlResponse( /** * returns a random SolrClient -- either a CloudSolrClient, or an HttpSolrClient pointed at a node - * in our cluster + * in our cluster We have different CLIENTS based on their wt setting. + */ + public static SolrClient getRandomClient(Random rand) { + int numClients = CLIENTS.size(); + int idx = TestUtil.nextInt(rand, 0, numClients); + if (idx == numClients) { + // Return the CloudSolrClient, it only uses javabin writerType. + return COLLECTION_CLIENT; + } else { + // Grabbing the first + int rnd = random().nextInt(CLIENTS.get(idx).values().toArray().length); + return (SolrClient) CLIENTS.get(idx).values().toArray()[rnd]; Review Comment: Seems very convoluted... no need to create an array twice. Not even sure why need to create an array? -- 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