You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ni...@apache.org on 2022/04/12 19:50:10 UTC

[ignite] branch master updated: IGNITE-16839 Fix SqlStatisticsUserQueriesFastTest.testLocalSelectFailed (#9965)

This is an automated email from the ASF dual-hosted git repository.

nizhikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 8876cfe2ff6 IGNITE-16839 Fix SqlStatisticsUserQueriesFastTest.testLocalSelectFailed (#9965)
8876cfe2ff6 is described below

commit 8876cfe2ff6e8a408de6d4c29698f93fa2697147
Author: Nikolay <ni...@apache.org>
AuthorDate: Tue Apr 12 22:50:01 2022 +0300

    IGNITE-16839 Fix SqlStatisticsUserQueriesFastTest.testLocalSelectFailed (#9965)
---
 .../ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java
index 83e4c2e7ee4..41d0559f934 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java
@@ -27,6 +27,7 @@ import javax.cache.CacheException;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.internal.processors.query.IgniteSQLException;
 import org.apache.ignite.internal.processors.query.RunningQueryManager;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.transactions.TransactionDuplicateKeyException;
@@ -286,10 +287,16 @@ public class SqlStatisticsUserQueriesFastTest extends UserQueriesTestBase {
      */
     @Test
     public void testLocalSelectFailed() {
+        // Lazy query fails on `getAll`.
+        // `getAll' don't wrap IgniteSQLException with CacheException.
+        Class<? extends Throwable> expErr = GridTestUtils.getFieldValue(SqlFieldsQuery.class, "DFLT_LAZY")
+            ? IgniteSQLException.class
+            : CacheException.class;
+
         assertMetricsIncrementedOnlyOnReducer(() -> GridTestUtils.assertThrows(
             log,
             () -> cache.query(new SqlFieldsQuery("SELECT * FROM TAB WHERE ID = failFunction()").setLocal(true)).getAll(),
-            CacheException.class,
+            expErr,
             null),
             "failed");
     }