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:
Vũ Thế Huy authored and GitHub committed 2026-09-21 15:24:12 -04:00
1 parent 76a0b865ca
commit cc767e8976
2 files changed
+5 -3

No files matched your search

@@ -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);
}
}
@@ -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() {