fix(ps80-binary-tarball): tear down molecule EC2 instances on failure#1138
Open
nogueiraanderson wants to merge 1 commit into
Open
fix(ps80-binary-tarball): tear down molecule EC2 instances on failure#1138nogueiraanderson wants to merge 1 commit into
nogueiraanderson wants to merge 1 commit into
Conversation
…nce leak The ps80-binary-tarball molecule scenarios launch on-demand EC2 instances via the create playbook but do not reliably tear them down, leaking tagged on-demand VMs per build of the test-ps-binary-tarball job: - Several scenarios (oracle-8/9, rhel-10, debian-12, ubuntu-jammy) had destroy commented out of both test_sequence and destroy_sequence and no destroy playbook wired, so 'molecule test' never destroyed and the post-build 'molecule destroy' had no playbook to run. - The scenarios that did wire a destroy pointed at destroy-noble-arm.yml, which terminates purely from molecule instance-config (instance_id); when that file is absent (a separate post 'molecule destroy' invocation with a fresh ephemeral dir) it sets skip_instances and terminates nothing. Fix: - Add playbooks/destroy.yml that terminates this run's instances deterministically by the unique Name tag (osprefix-BUILD_NUMBER-JOB_NAME set by the create playbook), independent of molecule instance-config. - Wire provisioner.playbooks.destroy = ../../playbooks/destroy.yml uniformly in all 9 ec2-driver OS scenarios. - Re-enable destroy as the last step of test_sequence and add destroy_sequence: [destroy] in all 9 scenarios.
kaushikpuneet07
approved these changes
May 30, 2026
Collaborator
kaushikpuneet07
left a comment
There was a problem hiding this comment.
Looks good to Me
Grishma123-Eng
approved these changes
Jun 2, 2026
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.
Bug
ps80-binary-tarballmolecule scenarios never tear down their EC2 instances: eachmolecule/<os>/molecule.ymlhasdestroycommented out oftest_sequenceand no destroy playbook wired, andplaybooks/destroy.ymldoes not exist.test-ps-binary-tarballjob (6 per build) and were terminated manually.Fix
playbooks/destroy.ymlthat terminates by the uniqueNametag (<os>-${BUILD_NUMBER}-${JOB_NAME}, scoped to the platform region). It readsmolecule_yml.platforms[].name, the same valuecreate.ymltags asName, so teardown works even when molecule instance-config was never written (early create/SSH failures).destroyas the final step oftest_sequenceand adddestroy_sequenceacross all 9 EC2 scenarios, so molecule tears down on success and on verify/converge failure.Notes
Name, so it cannot affect another build or job. The pipelinepost { always } molecule destroyis the backstop and now resolves to a working destroy playbook.