Skip to content

testutil: control-plane error contract and rotation-seam tests - #12

Open
Kiran01bm wants to merge 1 commit into
kiran01bm/ministack-aurorafrom
kiran01bm/ministack-test-themes
Open

testutil: control-plane error contract and rotation-seam tests#12
Kiran01bm wants to merge 1 commit into
kiran01bm/ministack-aurorafrom
kiran01bm/ministack-test-themes

Conversation

@Kiran01bm

Copy link
Copy Markdown
Collaborator

Summary

Adds two AWS-seam tests to the Ministack AWS-boundary tier: a control-plane error contract test (typed RDS fault matching) and a password-rotation seam test (rotation via ModifyDBCluster lands on the running database). Both are behaviors the engine's discovery and connection code will rely on in production.

What

  • ProvisionAuroraPostgres now returns an AuroraCluster handle (control-plane client, cluster/instance IDs, URL() / URLWithPassword()) so tests can drive further control-plane operations against the provisioned cluster.
  • TestAuroraControlPlaneErrorContract — describing an unknown cluster and creating duplicate cluster/instance identifiers surface as the AWS SDK's typed RDS faults, matched with errors.As, never by message text.
  • TestAuroraControlPlanePasswordRotationModifyDBCluster applies a new master password to the real database: the new password connects through pkg/dbconn, the stale one is refused with SQLSTATE 28P01 — the exact failure a mid-migration connection hits after a production rotation.
  • docs/testing.md — the tier-share section now lists all three Ministack tests and their seams; the planned-growth list drops IAM-auth (not planned) and adds rotation recovery (once pkg/dbconn grows a credential-refresh hook); logical replication is called out as a data-plane concern.

Why

The tier existed with one provisioning E2E; these tests pin down the two seams the engine hits first in production — control-plane error handling during discovery, and credential rotation mid-migration. The rotation test also establishes the baseline the future credential-refresh hook must recover from.

One emulator fidelity gap found and documented: Ministack's duplicate-instance wire code is DBInstanceAlreadyExistsFault, while real AWS emits DBInstanceAlreadyExists — so the SDK cannot map it to the typed fault and that one case matches by error-code prefix (holds against both the emulator and a real endpoint). Worth contributing a fix upstream.

References

Two AWS-seam tests join the Ministack tier: typed RDS fault matching for
unknown/duplicate identifiers, and master-password rotation landing on
the running database (stale password refused as 28P01). The duplicate-
instance case matches by error-code prefix because the emulator's wire
code carries a Fault suffix real AWS omits. ProvisionAuroraPostgres now
returns a cluster handle so tests can drive further control-plane calls.
@Kiran01bm
Kiran01bm marked this pull request as ready for review August 6, 2026 10:25
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant