Skip to content

fix: exclude DELETE_COMPLETE stacks at API level to prevent ListStack throttling#410

Merged
mollyheamazon merged 1 commit intoaws:mainfrom
mollyheamazon:fix/listStacks
Apr 16, 2026
Merged

fix: exclude DELETE_COMPLETE stacks at API level to prevent ListStack throttling#410
mollyheamazon merged 1 commit intoaws:mainfrom
mollyheamazon:fix/listStacks

Conversation

@mollyheamazon
Copy link
Copy Markdown
Collaborator

Problem

The canary account has accumulated 28,000+ DELETE_COMPLETE CloudFormation stacks from repeated test runs. HpClusterStack.list() was calling ListStacks without a status filter, causing ~280 paginated API calls to retrieve all stacks before filtering DELETE_COMPLETE in Python. This consistently hit CloudFormation's rate limit in the canary environment, causing test_describe_stack, test_check_status_static_method, and test_status_methods_consistency to fail with Throttling: Rate exceeded.

Fix

Pass StackStatusFilter to the ListStacks API call to exclude DELETE_COMPLETE stacks at the source. This reduces the result set from 28k+ entries to only active stacks, eliminating pagination entirely in most cases.

Changes

  • hp_cluster_stack.py: Apply StackStatusFilter with all active statuses when no explicit filter is provided; explicit caller-provided filters are still passed through unchanged
  • test/unit_tests/cluster_management/test_hp_cluster_stack.py: Update test_list_success and test_list_default_filters_delete_complete to assert API-level filtering; add test_list_with_explicit_status_filter
  • test/integration_tests/cluster_management/test_hp_cluster_stack.py: Add assertion that no DELETE_COMPLETE stacks appear in results

Testing

Verified locally that list_stacks is called with StackStatusFilter excluding DELETE_COMPLETE. Unit tests pass. Integ tests will validate against the real account.

Reviewer Guidelines

‼️ Merge Requirements: PRs with failing integration tests cannot be merged without justification.

One of the following must be true:

  • All automated PR checks pass
  • Failed tests include local run results/screenshots proving they work
  • Changes are documentation-only

@mollyheamazon mollyheamazon requested a review from a team as a code owner April 16, 2026 19:07
@mollyheamazon mollyheamazon merged commit c2726ce into aws:main Apr 16, 2026
5 of 6 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.

2 participants