mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
test(redshift): clean up a partially created shared cluster (#4005)
Record the shared cluster id before createCluster so @AfterAll still deletes a cluster left in the failed state by a partial creation.
This commit is contained in:
1 parent
76a0b865ca
commit
cc767e8976
2 files changed
+5
-3
No files matched your search
+4
-2
@@ -59,17 +59,19 @@ class RedshiftInterceptorIntegrationTest {
|
||||
IamService iamService;
|
||||
|
||||
private Cluster sharedCluster;
|
||||
private String sharedClusterId;
|
||||
|
||||
@BeforeAll
|
||||
void createSharedCluster() {
|
||||
Assumptions.assumeTrue(isDockerAvailable(), "Docker daemon must be available for Redshift interceptor integration tests");
|
||||
sharedClusterId = SHARED_CLUSTER_ID;
|
||||
sharedCluster = service.createCluster(SHARED_CLUSTER_ID, "dc2.large", "admin", "Secret123");
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
void deleteSharedCluster() {
|
||||
if (sharedCluster != null) {
|
||||
service.deleteCluster(SHARED_CLUSTER_ID);
|
||||
if (sharedClusterId != null) {
|
||||
service.deleteCluster(sharedClusterId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -34,8 +34,8 @@ class RedshiftDataApiIntegrationTest {
|
||||
void createSharedCluster() {
|
||||
Assumptions.assumeTrue(dockerAvailable(), "Docker is required for Redshift Data API integration tests");
|
||||
RestAssuredJsonUtils.configureAwsContentTypes();
|
||||
redshift.createCluster(SHARED_CLUSTER_ID, "dc2.large", "admin", "Secret123");
|
||||
clusterId = SHARED_CLUSTER_ID;
|
||||
redshift.createCluster(SHARED_CLUSTER_ID, "dc2.large", "admin", "Secret123");
|
||||
}
|
||||
|
||||
private static boolean dockerAvailable() {
|
||||
|
||||
Reference in new issue
Block a user