fix: attribute idempotence failures to handlers correctly#4626
Open
psimaker wants to merge 1 commit intoansible:mainfrom
Open
fix: attribute idempotence failures to handlers correctly#4626psimaker wants to merge 1 commit intoansible:mainfrom
psimaker wants to merge 1 commit intoansible:mainfrom
Conversation
7 tasks
5ef5ed0 to
a45b291
Compare
When a handler is not idempotent, molecule incorrectly reports the calling task instead of the handler name. This happens because non_idempotent_tasks() only matches lines starting with "TASK" but ignores "RUNNING HANDLER" lines from Ansible output. Add "RUNNING HANDLER" prefix matching so handlers are correctly identified in idempotence failure reports. Fixes ansible#4414 Signed-off-by: psimaker <[email protected]>
a45b291 to
d7d81c1
Compare
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.
Summary
Fix idempotence test failure attribution for Ansible handlers.
When a handler is not idempotent,
_non_idempotent_tasks()incorrectlyreports the calling task name instead of the handler name. This happens
because the parser only matches
TASKprefixes in Ansible output, buthandlers appear as
RUNNING HANDLER [name]."RUNNING HANDLER"to the prefix match in_non_idempotent_tasks()Fixes #4414
Test plan
test_non_idempotent_tasks_handlervalidates the fix