Repository navigation
Conversation
Use a separate single-attempt client for synchronous Docker startup and cover creation with the fixture cleanup scope. Keep the default client and scenario assertions unchanged. Signed-off-by: Andre Kurait <akurait@amazon.com>
PR Summary by QodoBound Docker RDS requests without retrying instance creation
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
Wait for late publication before deleting after ambiguous client failure. Keep cleanup bounded and preserve failures on the original creation error. Cover late publication and unresolved cleanup with regression controls. Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Sekator778
left a comment
There was a problem hiding this comment.
Ran both tests on b3becaa and a create stalled for 200 s against a stub: one CreateDBInstance, ApiCallTimeoutException at 95 s, so no replay. One timing gap inline.
| assertEquals("preserved", query(port, "SELECT value FROM upgrade_probe")); | ||
| } finally { | ||
| client.deleteDBInstance(b -> b.dbInstanceIdentifier(id).skipFinalSnapshot(true)); | ||
| cleanupDockerInstance(client, id, createFailure, Duration.ofSeconds(90)); |
There was a problem hiding this comment.
With the suite's 2m method default (pom.xml:823), a create that uses its 90 s leaves about 30 s here, and JUnit's timeout then hides the create failure. Budget only the time left, or give this test its own @Timeout?
There was a problem hiding this comment.
@Sekator778 Fixed in c5441b0: this fixture now has an explicit five-minute method timeout, leaving room for the bounded create and cleanup waits so the original create failure survives. All test sources compiled; five cleanup regressions and full Checkstyle passed.
Give the engine upgrade fixture a five-minute method timeout so its bounded create and cleanup waits preserve the original create failure. Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
|
The shard 4 failure is a separate PyPI retention race: hyphenated sdists and underscored wheels used different locks for the same package version. Fixed in #8201. The new regression fails on the baseline; the fix passes 52 focused tests and the unchanged seven-case real Docker integration suite. Test-owned containers and volumes were cleaned up. |
pgermosen
left a comment
There was a problem hiding this comment.
@AndreKurait thanks, the single-attempt client and the bounded cleanup read well, and the five-minute timeout leaves room for both waits.
One thing in RdsDockerCleanupTest: toleratesAbsentInstanceOnlyAfterServerRejection passes a mocked RdsException. The suite's subclass mock maker never runs Throwable's constructor, so addSuppressed on that mock records nothing and getSuppressed() stays empty whatever cleanup does. With the DbInstanceNotFoundException catch removed from cleanupDockerInstance, the test still passes. A real exception, RdsException.builder().message("rejected").statusCode(400).build() as absent() builds its own, would make that assertion count.
Construct the rejection exception so the absent-instance cleanup assertion detects an incorrectly suppressed deletion failure. Signed-off-by: Andre Kurait <akurait@amazon.com>
|
@pgermosen Fixed in 08a4fd5. The rejection now uses a real |
pgermosen
left a comment
There was a problem hiding this comment.
@AndreKurait thanks, the rejection test now throws a real RdsException, so its empty suppressed list only holds while the not-found catch is there. Good to go.
|
🎉 This PR is included in version 2.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
A slow synchronous PostgreSQL startup can exceed the SDK's read deadline. Replaying CreateDBInstance then reports DBInstanceAlreadyExists although the first request created the database. A prior loopback probe reproduced this in 30.9 seconds.
Use a separate Docker-fixture client with a 90-second total request budget and one attempt; the default shared client stays unchanged. Creation is covered by cleanup. A server-rejected create may leave no instance, but an ambiguous client failure waits for late publication and deletion within a deadline. Each delete request uses the remaining budget. Unconfirmed cleanup is retained as a suppressed error on the original create failure.
Original upgrade rejection, metadata, endpoint, SQL version and data-preservation assertions remain byte-identical. The engine-upgrade method has an explicit five-minute JUnit timeout, allowing its bounded create and cleanup waits to preserve the original create failure. No production code changes.
Type of change
AWS Compatibility
Test-only correction; no new AWS behavior or protocol claim.
Testing
The timeout-only follow-up
c5441b082compiled all production and test sources and passed the five cleanup regressions plus full Checkstyle. The real-Docker lifecycle was not rerun for this annotation-only change.The previous head
b3becaa738, qualified against mainbabf8419f4, passed 17 tests across four classes, with zero failures/errors/skips: five cleanup regressions, eleven existing SDK consumer tests and the complete real-Docker PostgreSQL engine-upgrade scenario. Java 25 packaging, full Checkstyle, docs, partition, CloudFormation property-type and whitespace gates passed. Both observed containers and the actual mounted volume were verified absent after teardown.Two negative controls fail with the old immediate-not-found cleanup behavior: late publication is not retried, and unresolved cleanup is not reported. The corrected source was restored before final qualification. The published head's merge into that main produces the exact qualified tree.
Docker images were cached. Forced cold-start timing, real-Docker timeout fault injection, the full repository suite, native builds and live AWS were not run. The late-publication/error controls use an isolated mocked SDK client; the real-Docker run exercises the full successful lifecycle.
Risk and rollback
The request policy applies only to this Docker fixture. Failed or ambiguous creation can now spend a bounded cleanup interval rather than declaring absence immediately. Other deletion failures remain visible. Revert this test-only PR to restore the previous behavior.
Checklist