chesnokoff commented on code in PR #12354:
URL: https://github.com/apache/ignite/pull/12354#discussion_r2374749362


##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsQueryTest.java:
##########
@@ -488,4 +488,118 @@ public void testMultipleStatementsSql() throws Exception {
         assertTrue("Queries was not handled: " + expQrs, expQrs.isEmpty());
         assertEquals("Unexpected IDs: " + qryIds, qrsWithReads.size(), 
qryIds.size());
     }
+
+    /** */
+    private Collection<UUID> query(Query<?> qry) {
+        return query(qry, true);
+    }
+
+    /** */
+    private Collection<UUID> query(Query<?> qry, boolean fetchAll) {
+        Collection<UUID> expNodeIds = new ArrayList<>();
+
+        QueryCursor<?> cursor = null;
+
+        if (clientType == SERVER) {
+            cursor = srv.cache(DEFAULT_CACHE_NAME).query(qry);
+
+            expNodeIds.add(srv.localNode().id());
+        }
+        else if (clientType == CLIENT) {
+            cursor = client.cache(DEFAULT_CACHE_NAME).query(qry);
+
+            expNodeIds.add(client.localNode().id());
+        }
+        else if (clientType == THIN_CLIENT) {
+            cursor = thinClient.cache(DEFAULT_CACHE_NAME).query(qry);
+
+            expNodeIds.addAll(nodeIds(client.cluster().forServers().nodes()));
+        }
+
+        if (fetchAll)
+            cursor.getAll();
+        else {
+            Iterator<?> iter = cursor.iterator();
+
+            if (iter.hasNext())
+                iter.next();
+
+            cursor.close();
+        }
+
+        return expNodeIds;
+    }
+
+    /** */
+    private static class QueryCheckConfig {

Review Comment:
   We introduced new argument `fetchAll` so I think it's better to create data 
class to store query test config for better readability 



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

Reply via email to