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(tests): flaky integration tests in release pipeline #5485

Merged
merged 2 commits into from
Dec 19, 2019

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Dec 19, 2019

If multiple similar pipelines (patch pipelines, test pipelines) are
running the same CodeBuild test, they interfere with each other.

In particular, the 'test' pipeline (which tests modifications to the
pipeline before they are applied to the real pipeline) is triggered
off of the same branch and takes about as long as the real pipeline,
so tests are likely to execute at the same time and touch the same
stacks, thereby causing one of the tests to fail (and our release
pipeline to be flaky).

They two pipelines will have different CodeBuild projects though,
so name the stacks that are being touched after the CodeBuild project,
thereby ensuring isolation.


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

If multiple similar pipelines (patch pipelines, test pipelines) are
running the same CodeBuild test, they interfere with each other.

In particular, the 'test' pipeline (which tests modifications to the
pipeline before they are applied to the real pipeline) is triggered
off of the same branch and takes about as long as the real pipeline,
so tests are likely to execute at the same time and touch the same
stacks, thereby causing one of the tests to fail (and our release
pipeline to be flaky).

They two pipelines will have different CodeBuild projects though,
so name the stacks that are being touched after the CodeBuild project,
thereby ensuring isolation.
@rix0rrr rix0rrr self-assigned this Dec 19, 2019
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Dec 19, 2019
CODEBUILD_PROJECT=$(echo ${CODEBUILD_BUILD_ID:-} | cut -d: -f 1)

if [[ "${CODEBUILD_PROJECT:-}" != "" ]]; then
export STACK_NAME_PREFIX="${CODEBUILD_PROJECT}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be worth actually having the actual execution ID in there, too, so that even two concurrent executions of the same project don't interfere with each other? I'm not willing to die on that hill though!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we wanted that we could just generate a UUID4 at the start of the run. The downside of that is that we might accumulate garbage, if deploying succeeds but then something fails to clean up the stacks. After a while, our tests will fail because our account has filled up with stale resources, and will need maintenance.

If we do this, we get automatic overwriting of old stacks while still ensuring enough isolation where it matters.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@rix0rrr rix0rrr requested a review from eladb December 19, 2019 13:22
@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@mergify mergify bot merged commit 01800cf into master Dec 19, 2019
@mergify mergify bot deleted the huijbers/isolate-stacks branch December 19, 2019 13:54
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

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.

4 participants