Repository navigation
[FIX] Use the CloudFormation waiter for --prev-stack deletion - #629
Merged
noel-improv merged 1 commit intoOct 22, 2026
Merged
Conversation
The hand-rolled loop polled describe-stacks until it saw DELETE_COMPLETE, but describe-stacks fails once the stack is gone, so the status became empty and the loop never exited. It also spun forever on DELETE_FAILED. Use `aws cloudformation wait stack-delete-complete`, which handles a deleted stack, fails on DELETE_FAILED and has its own timeout, and exit with an error if it fails. Also fix the misplaced closing quote on the PREV_STACK_NAME echo line. Fixes awslabs#622 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
noel-improv
approved these changes
Oct 21, 2026
noel-improv
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for tracking this down. The diagnosis in #622 holds and the fix is right. I ran this against a live stack as well as the new block and all passed.
The echo quote fix is correct too. Nothing to change from my side. Approving!
oussamahansal
approved these changes
Oct 21, 2026
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
build-tests.sh --prev-stack <name>never got past the deletion wait. The loop polleddescribe-stacksuntil it sawDELETE_COMPLETE, butdescribe-stacksfails once the stack is gone, so the status came back empty and the loop kept going. It also kept going onDELETE_FAILED. This replaces the loop withaws cloudformation wait stack-delete-complete, which finishes once the stack is deleted, fails onDELETE_FAILED, and has its own timeout.Changes
describe-stackspolling loop withaws cloudformation wait stack-delete-complete --stack-name "$PREV_STACK_NAME" --region "$REGION_NAME". If the waiter fails, print anERROR:line andexit 1so the script doesn't go on tocreate-stack.PREV_STACK_NAMEecho line so it matches the lines around it.Problem
Related issue (if any): Fixes #622
Testing
Unit tests added/updated
Integration tests added (as appropriate)
Existing tests pass (
pytest)Tested manually (describe below)
bash -n integration-tests/build-tests.shpasses.shellcheck (
koalaman/shellcheck:stable) on the old and new script: the notes on the changed lines (SC2086 on the twodescribe-stackscalls, SC2291/SC2086 on the echo line) are gone, and no new findings appear. The total goes from 32 to 28. The remaining SC2086 on the existingdelete-stackline is left alone.I haven't run this against a live stack.
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
🤖 Generated with Claude Code