Awaiting to avoid flake while deleting SI
This commit is contained in:
@@ -23,6 +23,7 @@ import org.cloudfoundry.operations.services.ServiceInstance;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
class CreateInstanceWithServiceInstanceGuidSuffixTargetAcceptanceTest extends CloudFoundryAcceptanceTest {
|
||||
|
||||
@@ -90,7 +91,7 @@ class CreateInstanceWithServiceInstanceGuidSuffixTargetAcceptanceTest extends Cl
|
||||
deleteServiceInstance(SI_NAME);
|
||||
|
||||
// and the backing service is deleted
|
||||
assertThat(listServiceInstances()).doesNotContain(expectedServiceInstanceName);
|
||||
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(expectedServiceInstanceName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
class CreateInstanceWithServicesAcceptanceTest extends CloudFoundryAcceptanceTest {
|
||||
|
||||
@@ -91,8 +92,8 @@ class CreateInstanceWithServicesAcceptanceTest extends CloudFoundryAcceptanceTes
|
||||
deleteServiceInstance(SI_NAME);
|
||||
|
||||
// and the backing services are deleted
|
||||
assertThat(listServiceInstances()).doesNotContain(BACKING_SI_1_NAME);
|
||||
assertThat(listServiceInstances()).doesNotContain(BACKING_SI_2_NAME);
|
||||
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(BACKING_SI_1_NAME));
|
||||
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(BACKING_SI_2_NAME));
|
||||
|
||||
// TODO: another story to only remove the instances with service definition specified (https://github.com/spring-cloud/spring-cloud-app-broker/issues/316)
|
||||
// // service without specification has no applications bound to it
|
||||
|
||||
@@ -147,7 +147,8 @@ class UpdateInstanceWithNewServiceAcceptanceTest extends CloudFoundryAcceptanceT
|
||||
deleteServiceInstance(SI_NAME);
|
||||
|
||||
// and the backing service is deleted
|
||||
assertThat(listServiceInstances()).doesNotContain(NEW_BACKING_SI_NAME);
|
||||
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(NEW_BACKING_SI_NAME));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -153,7 +153,7 @@ class UpdateInstanceWithNewServiceAndTargetAcceptanceTest extends CloudFoundryAc
|
||||
deleteServiceInstance(SI_NAME);
|
||||
|
||||
// and the backing service is deleted
|
||||
assertThat(listServiceInstances()).doesNotContain(NEW_BACKING_SI_NAME);
|
||||
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(NEW_BACKING_SI_NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
class UpdateInstanceWithServicesAcceptanceTest extends CloudFoundryAcceptanceTest {
|
||||
|
||||
@@ -115,7 +116,7 @@ class UpdateInstanceWithServicesAcceptanceTest extends CloudFoundryAcceptanceTes
|
||||
deleteServiceInstance(SI_NAME);
|
||||
|
||||
// and the backing service is deleted
|
||||
assertThat(listServiceInstances()).doesNotContain(BACKING_SI_NAME);
|
||||
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(BACKING_SI_NAME));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user