From d13d4cceb6a2d07dbfdfe0430f637aca247fa657 Mon Sep 17 00:00:00 2001 From: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> Date: Sat, 14 Nov 2026 00:34:56 -0400 Subject: [PATCH] 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 at 01d61afd8a. 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 at 01d61afd8a. Both now wait for the status with the class's awaitStackStatus. --- .../CloudFormationDeletionPolicyIntegrationTest.java | 11 +++++++---- .../rds/RdsEngineVersionDockerIntegrationTest.java | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/test/java/io/floci/aws/services/cloudformation/CloudFormationDeletionPolicyIntegrationTest.java b/src/test/java/io/floci/aws/services/cloudformation/CloudFormationDeletionPolicyIntegrationTest.java index 9d68d9100a..c900f8c891 100644 --- a/src/test/java/io/floci/aws/services/cloudformation/CloudFormationDeletionPolicyIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/cloudformation/CloudFormationDeletionPolicyIntegrationTest.java @@ -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("ROLLBACK_COMPLETE")); + awaitStackStatus(stackId, "ROLLBACK_COMPLETE"); assertBucketExists(keptBucket); assertBucketDeleted(rolledBackBucket); } @@ -732,7 +732,7 @@ class CloudFormationDeletionPolicyIntegrationTest { String parentStackId = createStack(stackName, template); try { - assertThat(describeStacks(parentStackId), containsString("ROLLBACK_COMPLETE")); + 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); } diff --git a/src/test/java/io/floci/aws/services/rds/RdsEngineVersionDockerIntegrationTest.java b/src/test/java/io/floci/aws/services/rds/RdsEngineVersionDockerIntegrationTest.java index 419bfafdf1..b142dda286 100644 --- a/src/test/java/io/floci/aws/services/rds/RdsEngineVersionDockerIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/rds/RdsEngineVersionDockerIntegrationTest.java @@ -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