This is an automated email from the ASF dual-hosted git repository. bschuchardt pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push: new 2e89e84 GEODE-4995 ClusterStartupRule is inefficient when shutting down the cluster 2e89e84 is described below commit 2e89e840f040800a65721c161d3b4203acfd7ff0 Author: Bruce Schuchardt <bschucha...@pivotal.io> AuthorDate: Mon Apr 9 15:04:02 2018 -0700 GEODE-4995 ClusterStartupRule is inefficient when shutting down the cluster modified after() to shut down non-locators before shutting down locators, allowing membership coordination to stay in the locator instead of causing cascading movement of the role. --- .../org/apache/geode/test/dunit/rules/ClusterStartupRule.java | 1 + .../test/java/org/apache/geode/test/junit/rules/VMProvider.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/ClusterStartupRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/ClusterStartupRule.java index cbe1306..9224c2f 100644 --- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/ClusterStartupRule.java +++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/ClusterStartupRule.java @@ -127,6 +127,7 @@ public class ClusterStartupRule extends ExternalResource implements Serializable MemberStarterRule.disconnectDSIfAny(); // stop all the clientsVM before stop all the memberVM + occupiedVMs.values().forEach(x -> x.stopVMIfNotLocator(true)); occupiedVMs.values().forEach(x -> x.stopVM(true)); // delete any file under root dir diff --git a/geode-core/src/test/java/org/apache/geode/test/junit/rules/VMProvider.java b/geode-core/src/test/java/org/apache/geode/test/junit/rules/VMProvider.java index 9898305..dd7ca32 100644 --- a/geode-core/src/test/java/org/apache/geode/test/junit/rules/VMProvider.java +++ b/geode-core/src/test/java/org/apache/geode/test/junit/rules/VMProvider.java @@ -30,6 +30,15 @@ public abstract class VMProvider { public abstract VM getVM(); + public void stopVMIfNotLocator(boolean cleanWorkingDir) { + getVM().invoke(() -> { + if (!org.apache.geode.distributed.Locator.hasLocator()) { + ClusterStartupRule.stopElementInsideVM(); + MemberStarterRule.disconnectDSIfAny(); + } + }); + } + public void stopVM(boolean cleanWorkingDir) { getVM().invoke(() -> { ClusterStartupRule.stopElementInsideVM(); -- To stop receiving notification emails like this one, please contact bschucha...@apache.org.