Skip to content

Comments

register stack for cleanup in test_sync_infra_s3_bucket_option#8682

Open
licjun wants to merge 2 commits intodevelopfrom
fix-api-no-auth-appsec
Open

register stack for cleanup in test_sync_infra_s3_bucket_option#8682
licjun wants to merge 2 commits intodevelopfrom
fix-api-no-auth-appsec

Conversation

@licjun
Copy link
Contributor

@licjun licjun commented Feb 21, 2026

Which issue(s) does this change fix?

Cleaning API GW resource after test

Why is this change necessary?

The test_sync_infra_s3_bucket_option test method creates a CloudFormation stack but doesn't register it for cleanup in tearDown(). This causes the stack and its resources (including HTTP API Gateways) to be orphaned when the test completes.

How does it address the issue?

Adds the missing self.stacks.append({"name": stack_name}) line after the stack name is generated. This registers the stack for immediate cleanup in tearDown(), matching the pattern used in other test methods like test_sync_infra. Now the stack will be deleted immediately after the test completes, regardless of pass/fail status.

What side effects does this change have?

None. This aligns the cleanup behavior with all other sync integration tests. The stack will be deleted faster (immediately in tearDown() instead of waiting for the account reset Lambda), reducing the window for security scanners to detect orphaned resources.

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

@licjun licjun requested a review from a team as a code owner February 21, 2026 23:04
Copy link
Contributor

@reedham-aws reedham-aws left a comment

Choose a reason for hiding this comment

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

Code change looks small, but could you add more description as to what's happening? I don't really follow what this one-line change is going to fix.

@licjun licjun added this pull request to the merge queue Feb 23, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 23, 2026
@reedham-aws
Copy link
Contributor

reedham-aws commented Feb 23, 2026

Once #8687 gets merged we need to merge it here because that's what contains the fix for chardet version mismatch that caused the merge to develop to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants