Skip to content

Fix flaky AWSPREVIOUS read in Secrets Manager integration test - #155

Merged
arandito merged 1 commit into
developfrom
fix-secrets-manager-integ-tests
Nov 24, 2026
Merged

arandito merged 1 commit into
developfrom
fix-secrets-manager-integ-tests

Conversation

@arandito

Copy link
Copy Markdown
Contributor

Description

In test_new_version_rotates_current_and_previous_stages, the AWSPREVIOUS label isn't always readable right after PutSecretValue. If the test reads it too early, GetSecretValue raises ResourceNotFoundException. The wait_until around that read didn't retry this exception, so the test failed instead of waiting.

Fix

Pass retry_on=(ResourceNotFoundException,) to the wait_until call. The other reads in this file already do this. Any other error still fails the test immediately.

Testing

Ran the test locally in async and sync modes. Both passed.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@arandito
arandito requested a review from a team as a code owner November 24, 2026 18:16
GetSecretValueInput(secret_id=secret_name, version_stage="AWSPREVIOUS")
),
done=lambda r: r.version_id == original.version_id,
retry_on=(ResourceNotFoundException,),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other similar calls. Is this one particularly susceptible to this failure?

@arandito arandito Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s the only read that asks for something the write creates and doesn’t already retry ResourceNotFoundException. The other reads after the put ask for things that already existed (AWSCURRENT, the version list), so a lagging read returns old data that done retries instead of raising.

@arandito

arandito commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

The PR build succeeded but the build request was throttled for 36 min due to our concurrency limit. The GitHub job timed out at 19:16, before the build finished. Merging.

@arandito
arandito merged commit 4fed961 into develop Nov 24, 2026
4 of 5 checks passed
@jonathan343
jonathan343 deleted the fix-secrets-manager-integ-tests branch November 24, 2026 21:44
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.

4 participants