Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky test TestAccKmsAliasTs #3818

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

flostadler
Copy link
Contributor

@flostadler flostadler commented Apr 15, 2024

The test is creating a KMS key alias with a static name. When multiple
instances of this test are running in the same AWS account and region they'll race
and occasionally fail because the alias already exists.

This changes the key alias to use a name prefix to guarantee uniqueness.

This fixes: #3817

The test is creating a KMS key alias with a static name. When multiple
instances of this test are running in the same AWS account and region they'll race
and occasionally fail because the alias already exists.

This changes the key alias to use a name prefix to guarantee uniqueness.
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@flostadler flostadler self-assigned this Apr 15, 2024
@flostadler
Copy link
Contributor Author

/run-acceptance-tests

@pulumi-bot
Copy link
Contributor

Please view the PR build: https://github.com/pulumi/pulumi-aws/actions/runs/8690888034

@flostadler flostadler marked this pull request as ready for review April 15, 2024 14:46
@@ -23,7 +23,7 @@ const aliasAutoPrefixedWithAlias = new aws.kms.Alias("should-be-prefixed", {targ

const aliasWithDedicatedName = new aws.kms.Alias("wont-be-autonamed", {
targetKeyId: key.keyId,
name: "alias/my-decicated-name"
namePrefix: "alias/my-decicated-name-"
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this test might be intentionally testing setting a specific name. I can't think of a good reason for that though so this change looks good to me!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did think about generating a random name and using that for the name parameter, but I also couldn't think of a reason to keep it that way.

Alternatively we could test all three cases (auto-generated name, name, namePrefix)

@flostadler flostadler merged commit 28d6e36 into pulumi:master Apr 15, 2024
12 checks passed
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.

Flaky TestAccKmsAliasTs
4 participants