Repository: jclouds Updated Branches: refs/heads/1.7.x c29f7e6a9 -> 1667c8699
JCLOUDS-573: Make sure to destroy all nodes created in the tests Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/1667c869 Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/1667c869 Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/1667c869 Branch: refs/heads/1.7.x Commit: 1667c86998a790d38b0dad2bfac78d33ee66df91 Parents: c29f7e6 Author: Ignasi Barrera <[email protected]> Authored: Tue May 20 13:00:11 2014 +0200 Committer: Ignasi Barrera <[email protected]> Committed: Wed May 21 09:33:41 2014 +0200 ---------------------------------------------------------------------- .../jclouds/compute/internal/BaseComputeServiceLiveTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds/blob/1667c869/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java ---------------------------------------------------------------------- diff --git a/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java b/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java index dbdba20..478f0af 100644 --- a/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java @@ -18,6 +18,7 @@ package org.jclouds.compute.internal; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Predicates.and; +import static com.google.common.base.Predicates.in; import static com.google.common.base.Predicates.not; import static com.google.common.collect.ImmutableSet.copyOf; import static com.google.common.collect.Iterables.concat; @@ -887,7 +888,10 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte protected void tearDownContext() { try { if (nodes != null) { - client.destroyNodesMatching(inGroup(group)); + // Destroy all nodes in the group but also make sure to destroy other created nodes that might not be in it. + // The "testCreateTwoNodesWithOneSpecifiedName" creates nodes with an explicit name that puts them outside the group, + // so the list of nodes should also be taken into account when destroying the nodes. + client.destroyNodesMatching(Predicates.<NodeMetadata> or(inGroup(group), in(nodes))); } } catch (Exception e) {
