alex-plekhanov commented on code in PR #12087: URL: https://github.com/apache/ignite/pull/12087#discussion_r2152384040
########## modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java: ########## @@ -583,24 +704,55 @@ public void runDml(String dml) { assertTrue(lsnrDml.check()); } + /** + * @param loc Flag indicating if the query is local. + * @return Query id. + */ + public long runNotFullyFetchedQuery(boolean loc) { Review Comment: private ########## modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java: ########## @@ -583,24 +704,55 @@ public void runDml(String dml) { assertTrue(lsnrDml.check()); } + /** + * @param loc Flag indicating if the query is local. + * @return Query id. + */ + public long runNotFullyFetchedQuery(boolean loc) { + queryCursor(loc).iterator().next(); + + checkQryInfoCount(loc ? 1 : gridCount()); + + H2QueryInfo qryInfo = (H2QueryInfo)heavyQueriesTracker().getQueries().iterator().next(); + + assertTrue(qryInfo.isSuspended()); + + return qryInfo.queryId(); + } + + /** + * @param loc Flag indicating if the query is local. + * @return Query cursor. + */ + public FieldsQueryCursor<List<?>> queryCursor(boolean loc) { Review Comment: private ########## modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java: ########## @@ -583,24 +704,55 @@ public void runDml(String dml) { assertTrue(lsnrDml.check()); } + /** + * @param loc Flag indicating if the query is local. + * @return Query id. + */ + public long runNotFullyFetchedQuery(boolean loc) { + queryCursor(loc).iterator().next(); + + checkQryInfoCount(loc ? 1 : gridCount()); + + H2QueryInfo qryInfo = (H2QueryInfo)heavyQueriesTracker().getQueries().iterator().next(); + + assertTrue(qryInfo.isSuspended()); + + return qryInfo.queryId(); + } + + /** + * @param loc Flag indicating if the query is local. + * @return Query cursor. + */ + public FieldsQueryCursor<List<?>> queryCursor(boolean loc) { + return ignite.cache("test").query(new SqlFieldsQuery("select * from test").setLocal(loc).setPageSize(1)); + } + + /** + * @param qryId Query id. + */ + public void cancelQuery(long qryId) { Review Comment: private ########## modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java: ########## @@ -643,7 +795,29 @@ private ListeningTestLogger testLog() { * @return Heavy queries tracker. */ private HeavyQueriesTracker heavyQueriesTracker() { - return ((IgniteH2Indexing)grid().context().query().getIndexing()).heavyQueriesTracker(); + return heavyQueriesTracker(0); + } + + /** */ + private HeavyQueriesTracker heavyQueriesTracker(int idx) { + return ((IgniteH2Indexing)grid(idx).context().query().getIndexing()).heavyQueriesTracker(); + } + + /** */ + private void checkQryInfoCount(int exp) { + int res = 0; + + for (int i = 0; i < gridCount(); i++) { + if (!heavyQueriesTracker(i).getQueries().isEmpty()) + res++; + } + + assertEquals(exp, res); + } + + /** */ + public int gridCount() { Review Comment: private -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org