Fixed a bug: we must wait for the configuration to be effectively removed at the end of each test iteration.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1704089 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ServiceRaceTest.java b/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ServiceRaceTest.java
index 47819cd..fd2785d 100644
--- a/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ServiceRaceTest.java
+++ b/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ServiceRaceTest.java
@@ -207,10 +207,12 @@
         });
         
         // Remove configuration (asynchronously)
+        final Ensure stepConfDeleted = new Ensure(false);
         schedule(new Runnable() {
             public void run() {
                 try {
                     conf.delete();
+                    stepConfDeleted.step(1);
                 }
                 catch (IOException e) {
                     warn("error while unconfiguring", e);
@@ -222,6 +224,8 @@
         expectedStep += 2; // stop/destroy
         expectedStep += DEPENDENCIES; // removed all dependencies
         step.waitForStep(expectedStep, STEP_WAIT);
+        // Make sure configuration is removed
+        stepConfDeleted.waitForStep(1, STEP_WAIT);
         step.ensure();
         Assert.assertEquals(0, clientImpl.getDependencies());