alex-plekhanov commented on code in PR #12749:
URL: https://github.com/apache/ignite/pull/12749#discussion_r2827674755


##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java:
##########


Review Comment:
   Let's fix this mess too:
   ```
               ConcurrentMap<UUID, ?> map = U.field(
                   
((IgniteH2Indexing)grid(0).context().query().getIndexing()).mapQueryExecutor(), 
"qryRess");
   ```



##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java:
##########
@@ -104,18 +103,17 @@ private void testQueryCancel(Ignite ignite, String 
cacheName, String sql, int ti
         else {
             cursor = cache.query(qry);
 
-            ignite.scheduler().runLocal(new Runnable() {
-                @Override public void run() {
-                    cursor.close();
-                }
-            }, timeoutUnits, timeUnit);
+            ignite.scheduler().runLocal(cursor::close, timeoutUnits, timeUnit);
         }
 
         try (QueryCursor<List<?>> ignored = cursor) {
-            cursor.getAll();
+            int resSize = 0;
+            for (List<?> ignored1 : cursor) {
+                ++resSize;
+            }

Review Comment:
   `int resSize = F.size(cursor.iterator());`?



##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java:
##########
@@ -91,7 +90,7 @@ public void testTimeout4() throws Exception {
     /** */
     private void testQueryCancel(Ignite ignite, String cacheName, String sql, 
int timeoutUnits, TimeUnit timeUnit,
                            boolean timeout, boolean checkCanceled) throws 
Exception {
-        SqlFieldsQuery qry = new SqlFieldsQuery(sql).setDistributedJoins(true);
+        SqlFieldsQuery qry = new 
SqlFieldsQuery(sql).setDistributedJoins(true);;

Review Comment:
   Redundant `;`



##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest.java:
##########
@@ -104,18 +103,17 @@ private void testQueryCancel(Ignite ignite, String 
cacheName, String sql, int ti
         else {
             cursor = cache.query(qry);
 
-            ignite.scheduler().runLocal(new Runnable() {
-                @Override public void run() {
-                    cursor.close();
-                }
-            }, timeoutUnits, timeUnit);
+            ignite.scheduler().runLocal(cursor::close, timeoutUnits, timeUnit);
         }
 
         try (QueryCursor<List<?>> ignored = cursor) {
-            cursor.getAll();
+            int resSize = 0;
+            for (List<?> ignored1 : cursor) {

Review Comment:
   `testCancel3` fails sometimes here locally:
   ```
   org.apache.ignite.IgniteException: The query was cancelled while executing.
        at 
org.apache.ignite.internal.util.lang.GridIteratorAdapter.next(GridIteratorAdapter.java:38)
        at 
org.apache.ignite.internal.processors.query.GridQueryCacheObjectsIterator.next(GridQueryCacheObjectsIterator.java:67)
        at 
org.apache.ignite.internal.processors.query.GridQueryCacheObjectsIterator.next(GridQueryCacheObjectsIterator.java:31)
        at 
org.apache.ignite.internal.processors.cache.QueryCursorImpl$LazyIterator.next(QueryCursorImpl.java:287)
        at 
org.apache.ignite.internal.processors.query.h2.RegisteredQueryCursor$RegisteredIterator.next(RegisteredQueryCursor.java:181)
   ```
   It happens when query cancelled during fetch (after `iterator()` call and 
before all result processed). Exception was wrapped to `IgniteException`, but 
`CacheException` expected.



##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryAbstractDistributedJoinSelfTest.java:
##########
@@ -77,7 +74,7 @@ public class IgniteCacheQueryAbstractDistributedJoinSelfTest 
extends AbstractInd
     private static final int PERS_CNT = 600;
 
     /** */
-    private static final int PURCHASE_CNT = 6_000;
+    private static final int PURCHASE_CNT = 24_000;

Review Comment:
   It still looks fragile. On fast environment we will again face this problem. 
Maybe use functions to guarantee long time execution (sleep, latch)?



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