aparnasuresh85 commented on code in PR #2493:
URL: https://github.com/apache/solr/pull/2493#discussion_r1697348772


##########
solr/core/src/test/org/apache/solr/TestTimeAllowedSearch.java:
##########
@@ -0,0 +1,104 @@
+package org.apache.solr;
+
+import com.carrotsearch.randomizedtesting.generators.RandomStrings;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Locale;
+import java.util.TimeZone;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.cloud.MiniSolrCloudCluster;
+import org.apache.solr.cloud.SolrCloudTestCase;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.CommonParams;
+import org.apache.solr.common.params.ShardParams;
+
+public class TestTimeAllowedSearch extends SolrCloudTestCase {
+
+  /**
+   * This test demonstrates timeAllowed expectation at @{@link
+   * org.apache.solr.handler.component.HttpShardHandler} level This test 
creates collection with
+   * 'implicit` router, which has two shards shard_1 has 100000 docs, so that 
query should take some
+   * time shard_2 has only 1 doc to demonstrate the HttpSHardHandler timeout 
Then it execute
+   * substring query with TIME_ALLOWED 50, assuming this query will time out 
on shard_1
+   */
+  public void testTimeAllowed() throws Exception {
+    MiniSolrCloudCluster cluster =
+        configureCluster(2).addConfig("conf", 
configset("cloud-minimal")).configure();
+    try {

Review Comment:
   try-with-resources for CloudSolrClient



-- 
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

Reply via email to