You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by al...@apache.org on 2021/04/16 07:17:52 UTC

[ignite] branch sql-calcite updated: IGNITE-14289 Fix flaky CancelTest.testNotOriginatorNodeStop - Fixes #8982.

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

alexpl pushed a commit to branch sql-calcite
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/sql-calcite by this push:
     new 31e2930  IGNITE-14289 Fix flaky CancelTest.testNotOriginatorNodeStop - Fixes #8982.
31e2930 is described below

commit 31e2930ffd38a793238369ab9d62cc1dc4442fdf
Author: Aleksey Plekhanov <pl...@gmail.com>
AuthorDate: Fri Apr 16 10:14:57 2021 +0300

    IGNITE-14289 Fix flaky CancelTest.testNotOriginatorNodeStop - Fixes #8982.
    
    Signed-off-by: Aleksey Plekhanov <pl...@gmail.com>
---
 .../processors/query/calcite/CancelTest.java         | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CancelTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CancelTest.java
index b20c3c3..be86124 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CancelTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CancelTest.java
@@ -28,14 +28,15 @@ import org.apache.ignite.cache.query.FieldsQueryCursor;
 import org.apache.ignite.cache.query.QueryCursor;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
 import org.apache.ignite.internal.processors.query.IgniteSQLException;
 import org.apache.ignite.internal.processors.query.QueryEngine;
+import org.apache.ignite.internal.processors.query.calcite.metadata.RemoteException;
 import org.apache.ignite.internal.processors.query.calcite.util.Commons;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static java.util.Collections.singletonList;
@@ -114,7 +115,6 @@ public class CancelTest extends GridCommonAbstractTest {
     /**
      *
      */
-    @Ignore("https://issues.apache.org/jira/browse/IGNITE-14289")
     @Test
     public void testNotOriginatorNodeStop() throws Exception {
         QueryEngine engine = Commons.lookupComponent(grid(0).context(), QueryEngine.class);
@@ -130,14 +130,22 @@ public class CancelTest extends GridCommonAbstractTest {
 
         stopGrid(1);
 
-        GridTestUtils.assertThrowsAnyCause(log, () -> {
+        Throwable ex = GridTestUtils.assertThrows(log, () -> {
                 while (it.hasNext())
                     it.next();
 
                 return null;
-            },
-            ClusterTopologyCheckedException.class, "node left"
-        );
+            }, IgniteSQLException.class, null);
+
+        // Sometimes remote node during stopping can send error to originator node and this error processed before
+        // node left event, in this case exception stack will looks like:
+        // IgniteSQLException -> RemoteException -> IgniteInterruptedCheckedException
+        if (!X.hasCause(ex, "node left", ClusterTopologyCheckedException.class) && !(X.hasCause(ex,
+            RemoteException.class) && X.hasCause(ex, IgniteInterruptedCheckedException.class))) {
+            log.error("Unexpected exception", ex);
+
+            fail("Unexpected exception: " + ex);
+        }
 
         awaitReservationsRelease(grid(0), "TEST");
     }