You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ib...@apache.org on 2022/10/07 07:53:37 UTC

[ignite] branch master updated: IGNITE-17837 CacheExchangeMergeTest.testConcurrentStartServers sometimes hangs forever (#10290)

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

ibessonov 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 97cf70cc9ee IGNITE-17837 CacheExchangeMergeTest.testConcurrentStartServers sometimes hangs forever (#10290)
97cf70cc9ee is described below

commit 97cf70cc9ee75a4c7aabde102319f6ae4a266639
Author: Roman Puchkovskiy <ro...@gmail.com>
AuthorDate: Fri Oct 7 11:53:29 2022 +0400

    IGNITE-17837 CacheExchangeMergeTest.testConcurrentStartServers sometimes hangs forever (#10290)
    
    The problem is that, if a grid fails to start (for instance, due to PME), then the test times out, then afterTest() is called which calls stopAllGrids(), which, in turn, waits for all grids to be started, so it hangs as well, this time forever (as the timeout is not applied to afterTest()).
    
    We try to solve the problem by using the variation of stopAllGrids() that does not wait for the grids to start and tries to stop them regargless of their state.
---
 .../processors/cache/distributed/CacheExchangeMergeTest.java     | 2 +-
 .../org/apache/ignite/testframework/junits/GridAbstractTest.java | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
index 8e891d2c73e..1eaf377918f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
@@ -190,7 +190,7 @@ public class CacheExchangeMergeTest extends GridCommonAbstractTest {
     @Override protected void afterTest() throws Exception {
         listeningLog.clearListeners();
 
-        stopAllGrids();
+        stopAllGridsNoWait();
 
         super.afterTest();
     }
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index 95b0ae37abe..e83ff92d63c 100755
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -1608,6 +1608,15 @@ public abstract class GridAbstractTest extends JUnitAssertAware {
         }
     }
 
+    /**
+     * Stops all grids (even those grids that have not been started successfully are tried to be stopped).
+     * This differs from {@link #stopAllGrids()} in one aspect: {@code stopAllGrids()} waits for all grids
+     * to be started, and, if any of them hangs during startup, it hangs as well.
+     */
+    protected void stopAllGridsNoWait() {
+        stopAllGrids(true, false);
+    }
+
     /**
      * @param cancel Cancel flag.
      */