Repository: jclouds Updated Branches: refs/heads/master 11b778bbb -> 22a602833
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/22a60283 Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/22a60283 Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/22a60283 Branch: refs/heads/master Commit: 22a60283363f96264cebfab9a4eb1682e1e96c54 Parents: 11b778b Author: Ignasi Barrera <[email protected]> Authored: Tue May 20 13:00:11 2014 +0200 Committer: Ignasi Barrera <[email protected]> Committed: Wed May 21 09:21:31 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/22a60283/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 45b7f51..0517aa1 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) {
