You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/02/03 19:38:41 UTC

[GitHub] [solr] dsmiley commented on a change in pull request #589: SOLR-15124: Fix ThreadDumpHandlerTest

dsmiley commented on a change in pull request #589:
URL: https://github.com/apache/solr/pull/589#discussion_r798903074



##########
File path: solr/core/src/test/org/apache/solr/handler/admin/ThreadDumpHandlerTest.java
##########
@@ -245,21 +253,18 @@ public void doTestOwnableSync(final boolean checkWaitingThreadViaPolling) throws
     }
   }
 
-  @SuppressWarnings({"unchecked"})
-  private NamedList<Object> readProperties() throws Exception {
+  private void request(String path, Consumer<NamedList<?>> consumer) throws Exception {
     SolrClient client = new EmbeddedSolrServer(h.getCore());
-
-    NamedList<Object> properties = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, "/admin/info/threads",
-            new ModifiableSolrParams()));
-    return properties;
+    ModifiableSolrParams mparams = new ModifiableSolrParams();
+    mparams.set("indent", true);
+    NamedList<?> rsp = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, path, mparams));
+    consumer.accept(rsp);
   }
 
-  @SuppressWarnings({"unchecked"})
-  private NamedList<Object> getThread(NamedList<Object> threads, String threadName) {
-    for (Map.Entry<String, Object> threadEntry : threads) {
-      @SuppressWarnings({"unchecked"})
-      NamedList<Object> thread = (NamedList<Object>) threadEntry.getValue();
-      if (thread._getStr("name",  null).contains(threadName)) {
+  private NamedList<?> getThreadInfo(NamedList<?> req, String threadName) {

Review comment:
       The first arg is the *response* not a *request*




-- 
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-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org