-
Notifications
You must be signed in to change notification settings - Fork 154
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
Conversation
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.
PR is now waiting for a maintainer to run the acceptance tests. |
/run-acceptance-tests |
Please view the PR build: https://github.com/pulumi/pulumi-aws/actions/runs/8690888034 |
@@ -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-" |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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)
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