You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2014/11/05 15:34:54 UTC

[3/4] git commit: fix BrooklynNodeIntegrationTest.testStopPlainThrowsException

fix BrooklynNodeIntegrationTest.testStopPlainThrowsException

- Test was leaving brooklyn process running

Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/34406797
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/34406797
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/34406797

Branch: refs/heads/master
Commit: 344067970e305843b1703bc34c38f18659de038f
Parents: 66cbad2
Author: Aled Sage <al...@gmail.com>
Authored: Wed Nov 5 13:35:08 2014 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Wed Nov 5 13:35:08 2014 +0000

----------------------------------------------------------------------
 .../entity/brooklynnode/BrooklynNodeIntegrationTest.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/34406797/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java b/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
index 27eb278..065996d 100644
--- a/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
+++ b/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
@@ -48,6 +48,7 @@ import brooklyn.entity.basic.BasicApplicationImpl;
 import brooklyn.entity.basic.Entities;
 import brooklyn.entity.brooklynnode.BrooklynNode.DeployBlueprintEffector;
 import brooklyn.entity.brooklynnode.BrooklynNode.ExistingFileBehaviour;
+import brooklyn.entity.brooklynnode.BrooklynNode.StopNodeAndKillAppsEffector;
 import brooklyn.entity.proxying.EntityProxyImpl;
 import brooklyn.entity.proxying.EntitySpec;
 import brooklyn.event.feed.http.JsonFunctions;
@@ -63,7 +64,6 @@ import brooklyn.test.entity.TestApplication;
 import brooklyn.util.collections.MutableMap;
 import brooklyn.util.config.ConfigBag;
 import brooklyn.util.exceptions.Exceptions;
-import brooklyn.util.exceptions.PropagatedRuntimeException;
 import brooklyn.util.guava.Functionals;
 import brooklyn.util.http.HttpTool;
 import brooklyn.util.http.HttpToolResponse;
@@ -72,6 +72,7 @@ import brooklyn.util.net.Networking;
 import brooklyn.util.net.Urls;
 import brooklyn.util.os.Os;
 import brooklyn.util.text.Strings;
+import brooklyn.util.time.Duration;
 
 import com.google.common.base.Charsets;
 import com.google.common.base.Function;
@@ -452,6 +453,12 @@ services:
             } else {
                 throw e;
             }
+        } finally {
+            try {
+                brooklynNode.invoke(BrooklynNode.STOP_NODE_AND_KILL_APPS, ImmutableMap.of(StopNodeAndKillAppsEffector.TIMEOUT.getName(), Duration.THIRTY_SECONDS)).getUnchecked();
+            } catch (Exception e) {
+                log.warn("Error in stopNodeAndKillApps for "+brooklynNode+" (continuing)", e);
+            }
         }
     }