mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
test(rds,cloudformation): load PgJDBC before the engine-version test connects, and wait for rollbacks (#8272)
The RDS engine-version test opened its connections through DriverManager, which hands out only a driver the caller's class loader can see. After a Quarkus restart the driver registered earlier belongs to another loader, so whenever a shard ran the test after an application of another profile it failed with "No suitable driver found", as main's shard 2 did at01d61afd8a. It now loads PgJDBC through its own loader first, as the blue/green and managed-password rotation tests do. CreateStack answers before its execution ends, so the two rollback tests that read ROLLBACK_COMPLETE right after creating the stack raced it; the nested-stack one saw CREATE_IN_PROGRESS in main's shard 5 at01d61afd8a. Both now wait for the status with the class's awaitStackStatus.
This commit is contained in:
1 parent
d9a43012de
commit
d13d4cceb6
2 files changed
+11
-5
No files matched your search
+7
-4
@@ -160,7 +160,7 @@ class CloudFormationDeletionPolicyIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void rollingBackAFailedCreateDeletesRetainExceptOnCreateButKeepsRetain() {
|
||||
void rollingBackAFailedCreateDeletesRetainExceptOnCreateButKeepsRetain() throws InterruptedException {
|
||||
String suffix = Long.toString(System.nanoTime(), 36);
|
||||
String keptBucket = "cfn-rollback-retain-bucket-" + suffix;
|
||||
String rolledBackBucket = "cfn-rollback-reoc-bucket-" + suffix;
|
||||
@@ -197,7 +197,7 @@ class CloudFormationDeletionPolicyIntegrationTest {
|
||||
|
||||
String stackId = createStack(stackName, template);
|
||||
|
||||
assertThat(describeStacks(stackId), containsString("<StackStatus>ROLLBACK_COMPLETE</StackStatus>"));
|
||||
awaitStackStatus(stackId, "ROLLBACK_COMPLETE");
|
||||
assertBucketExists(keptBucket);
|
||||
assertBucketDeleted(rolledBackBucket);
|
||||
}
|
||||
@@ -732,7 +732,7 @@ class CloudFormationDeletionPolicyIntegrationTest {
|
||||
|
||||
String parentStackId = createStack(stackName, template);
|
||||
try {
|
||||
assertThat(describeStacks(parentStackId), containsString("<StackStatus>ROLLBACK_COMPLETE</StackStatus>"));
|
||||
awaitStackStatus(parentStackId, "ROLLBACK_COMPLETE");
|
||||
assertBucketDeleted(bucketName);
|
||||
} finally {
|
||||
deleteStack(stackName);
|
||||
@@ -1479,7 +1479,10 @@ class CloudFormationDeletionPolicyIntegrationTest {
|
||||
.statusCode(200);
|
||||
}
|
||||
|
||||
/** DeleteStack runs asynchronously, and a deleted stack stays describable by its stack ID. */
|
||||
/**
|
||||
* CreateStack, UpdateStack and DeleteStack answer before their execution ends, and a deleted stack
|
||||
* stays describable by its stack ID.
|
||||
*/
|
||||
private static void awaitStackStatus(String stackId, String status) throws InterruptedException {
|
||||
awaitStackStatus(stackId, status, null);
|
||||
}
|
||||
|
||||
@@ -32,8 +32,11 @@ class RdsEngineVersionDockerIntegrationTest {
|
||||
private static final String PASSWORD = "Passw0rd12345";
|
||||
|
||||
@BeforeEach
|
||||
void checkDocker() throws InterruptedException {
|
||||
void checkDocker() throws InterruptedException, ClassNotFoundException {
|
||||
assumeDocker();
|
||||
// DriverManager hands out only a driver this test's class loader can see, and after a Quarkus
|
||||
// restart the one registered earlier belongs to another loader.
|
||||
Class.forName("org.postgresql.Driver");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user