pavlukhin commented on a change in pull request #6917: IGNITE-12189 
Implementation correct limit for TextQuery
URL: https://github.com/apache/ignite/pull/6917#discussion_r341481518
 
 

 ##########
 File path: 
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQuerySelfTest.java
 ##########
 @@ -120,28 +165,86 @@ public void testTextQueryWithKeepBinary() throws 
Exception {
         checkTextQuery(false, true);
     }
 
+    /**
+     * @throws Exception In case of error.
+     */
+    @Test
+    public void testTextQueryWithKeepBinaryLimited() throws Exception {
+        checkTextQuery(null, QUERY_LIMIT, false, true);
+    }
+
     /**
      * @throws Exception In case of error.
      */
     @Test
     public void testTextQuery() throws Exception {
-        checkTextQuery(false, true);
+        checkTextQuery(false, false);
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    @Test
+    public void testTextQueryLimited() throws Exception {
+        checkTextQuery(null, QUERY_LIMIT, false, false);
+    }
+
+    /**
+     * @throws Exception In case of error.
+     */
+    @Test
+    public void testTextQueryLimitedConcurrent() throws Exception {
+        final IgniteEx ignite = grid(0);
+
+        final String clause = "1*";
+
+        // 1. Populate cache with data, calculating expected count in parallel.
+        Set<Integer> exp = populateCache(ignite, false, MAX_ITEM_COUNT, 
(IgnitePredicate<Integer>)x -> String.valueOf(x).startsWith("1"));
+
+        ExecutorService executor = Executors.newFixedThreadPool(N_THREADS);
+
+        IntStream.range(0, N_THREADS).forEach((i) -> 
executor.submit(textQueryTask(ignite, clause, exp)));
 
 Review comment:
   It seems errors from submitted tasks do not propagate to main test thread. 
Consequently failures in tasks will not fail the test. I can suggest here to 
use 
`org.apache.ignite.testframework.GridTestUtils#runMultiThreaded(java.lang.Runnable,
 int, java.lang.String)` or someting similar to 
`java.util.concurrent.ExecutorService#invokeAll(java.util.Collection<? extends 
java.util.concurrent.Callable<T>>)` (and waiting on futures).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to