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(cli): cli integ tests do not have a unique stack prefix #9165

Merged
merged 3 commits into from Jul 20, 2020

Conversation

eladb
Copy link
Contributor

@eladb eladb commented Jul 20, 2020

Stack prefixes only included the codebuild project name and not the build id. There was also some legacy support in which the test prefix was cdk-toolkit-canary or cdk-toolkit-integration and it seems like these prefixes are no longer required.

This resulted in canaries failing when two instances executed concurrently: the "cleanup" code of one canary deleted stacks in-flight for the other canary.

We now simply use a timestamp to generate a unique prefix for each test run in order to isolate these stacks.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Stack prefixes only included the codebuild project _name_ and not the build id. There was also some legacy support in which the test prefix was `cdk-toolkit-canary` or `cdk-toolkit-integration` and it seems like these prefixes are no longer required.

This resulted in canaries failing when two instances executed concurrently: the "cleanup" code of one canary deleted stacks in-flight for the other canary.

We now simply use a timestamp to generate a unique prefix for each test run in order to isolate these stacks.
@eladb eladb requested a review from a team July 20, 2020 09:34
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jul 20, 2020
Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

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

Does this usage need to be cleaned up as well?

const stackPrefix = process.env.STACK_NAME_PREFIX || 'cdk-toolkit-integration';

@eladb
Copy link
Contributor Author

eladb commented Jul 20, 2020

Does this usage need to be cleaned up as well?

const stackPrefix = process.env.STACK_NAME_PREFIX || 'cdk-toolkit-integration';

No, this is where the app takes in the environment variable. But you know what? Let me change this so that it will fail if the environment variable is not defined, so we can avoid future mistakes.

@eladb eladb requested a review from njlynch July 20, 2020 09:42
@eladb
Copy link
Contributor Author

eladb commented Jul 20, 2020

@njlynch fixed

@eladb eladb merged commit 968c460 into master Jul 20, 2020
@eladb eladb deleted the benisrae/cli-integ-unique-prefix branch July 20, 2020 09:58
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 5a6a43f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Chriscbr pushed a commit to Chriscbr/aws-cdk that referenced this pull request Jul 23, 2020
Stack prefixes only included the codebuild project _name_ and not the build id. There was also some legacy support in which the test prefix was `cdk-toolkit-canary` or `cdk-toolkit-integration` and it seems like these prefixes are no longer required.

This resulted in canaries failing when two instances executed concurrently: the "cleanup" code of one canary deleted stacks in-flight for the other canary.

We now simply use a timestamp to generate a unique prefix for each test run in order to isolate these stacks.
curtiseppel pushed a commit to curtiseppel/aws-cdk that referenced this pull request Aug 11, 2020
Stack prefixes only included the codebuild project _name_ and not the build id. There was also some legacy support in which the test prefix was `cdk-toolkit-canary` or `cdk-toolkit-integration` and it seems like these prefixes are no longer required.

This resulted in canaries failing when two instances executed concurrently: the "cleanup" code of one canary deleted stacks in-flight for the other canary.

We now simply use a timestamp to generate a unique prefix for each test run in order to isolate these stacks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants