jaykay12 commented on code in PR #4452:
URL: https://github.com/apache/solr/pull/4452#discussion_r3320766647
##########
solr/core/src/test/org/apache/solr/search/TestTaskManagement.java:
##########
@@ -213,6 +213,46 @@ public void testCheckSpecificQueryStatus() throws
Exception {
assertTrue(result.contains("inactive"));
}
+ @Test
+ public void testCheckSpecificQueryStatus_Active() throws Exception {
+ for (int i = 0; i < 10; i++) {
+ executeQueryAsync(Integer.toString(i));
+ }
+
+ ModifiableSolrParams params = new ModifiableSolrParams();
+ params.set("taskUUID", "5");
+
+ var request =
+ new GenericSolrRequest(
+ SolrRequest.METHOD.GET, "/tasks/list",
SolrRequest.SolrRequestType.ADMIN, params)
+ .setRequiresCollection(true);
+ NamedList<Object> queryResponse =
cluster.getSolrClient(COLLECTION_NAME).request(request);
+
+ String result = (String) queryResponse.get("taskStatus");
+
+ assertTrue(result.contains("active"));
+ }
+
+ @Test
+ public void testCheckSpecificQueryStatus_Inactive() throws Exception {
+ for (int i = 0; i < 10; i++) {
Review Comment:
not a magic number, i am just executing 10 queries during test & since each
query gets fired with their index as taskID, so i am simply asserting for any
taskId=5 which should be active since it is <10 & asserting for taskId=15,
which should be inactive since its outside the range.
this number can be anything, should i keep this lower, like 2 or 3?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]