Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(2.0.x) Awaiting to avoid flake while deleting SI #980

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
(2.0.x) Awaiting to avoid flake while deleting SI
  • Loading branch information
Albertoimpl committed Mar 7, 2024
commit 2f39b255bd73a5a964af60a9d00ae178b56bc1d5
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

class CreateInstanceWithServiceInstanceGuidSuffixTargetAcceptanceTest extends CloudFoundryAcceptanceTest {

Expand Down Expand Up @@ -90,7 +91,7 @@ void deployAppsWithServiceInstanceGuidSuffixOnCreateService() {
deleteServiceInstance(SI_NAME);

// and the backing service is deleted
assertThat(listServiceInstances()).doesNotContain(expectedServiceInstanceName);
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(expectedServiceInstanceName));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import static java.util.Collections.emptyMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

class CreateInstanceWithServicesAcceptanceTest extends CloudFoundryAcceptanceTest {

Expand Down Expand Up @@ -91,8 +92,8 @@ void deployAppsAndCreateServicesOnCreateService() {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void weUpdateTheServiceInstanceWithANewBackingService() {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void weUpdateTheServiceInstanceWithANewBackingService() {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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 {

Expand Down Expand Up @@ -115,7 +116,7 @@ void shouldPushAppWithServicesBind() {
deleteServiceInstance(SI_NAME);

// and the backing service is deleted
assertThat(listServiceInstances()).doesNotContain(BACKING_SI_NAME);
await().untilAsserted(() -> assertThat(listServiceInstances()).doesNotContain(BACKING_SI_NAME));
}

}