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 2018/09/05 12:02:57 UTC

ignite git commit: IGNITE-8158: Wrap the method afterTestsStopped() call with try/catch. - Fixes #4464.

Repository: ignite
Updated Branches:
  refs/heads/master 1fd72477e -> 1894541ce


IGNITE-8158: Wrap the method afterTestsStopped() call with try/catch. - Fixes #4464.

Signed-off-by: Nikolay Izhikov <ni...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1894541c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1894541c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1894541c

Branch: refs/heads/master
Commit: 1894541ce0301b7f4950fd30efcde15d0c4200b3
Parents: 1fd7247
Author: zzzadruga <zz...@gmail.com>
Authored: Wed Sep 5 14:52:04 2018 +0300
Committer: Nikolay Izhikov <ni...@apache.org>
Committed: Wed Sep 5 14:52:55 2018 +0300

----------------------------------------------------------------------
 .../testframework/junits/GridAbstractTest.java  | 21 ++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1894541c/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
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 a1d6c25..ee0dfa4 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
@@ -1773,6 +1773,8 @@ public abstract class GridAbstractTest extends TestCase {
         finally {
             serializedObj.clear();
 
+            Exception err = null;
+
             if (isLastTest()) {
                 info(">>> Stopping test class: " + testClassDescription() + " <<<");
 
@@ -1787,11 +1789,22 @@ public abstract class GridAbstractTest extends TestCase {
                 // Set reset flags, so counters will be reset on the next setUp.
                 counters.setReset(true);
 
-                afterTestsStopped();
+                try {
+                    afterTestsStopped();
+                }
+                catch (Exception e) {
+                    err = e;
+                }
 
-                if(isSafeTopology())
+                if (isSafeTopology()) {
                     stopAllGrids(false);
 
+                    if (stopGridErr) {
+                        err = new RuntimeException("Not all Ignite instances has been stopped. " +
+                            "Please, see log for details.", err);
+                    }
+                }
+
                 // Remove counters.
                 tests.remove(getClass());
 
@@ -1808,8 +1821,8 @@ public abstract class GridAbstractTest extends TestCase {
 
             cleanReferences();
 
-           if (isLastTest() && isSafeTopology() && stopGridErr)
-               throw new RuntimeException("Not all Ignite instances has been stopped. Please, see log for details.");
+            if (err != null)
+                throw err;
         }
     }