generated from linux-system-roles/template
-
Notifications
You must be signed in to change notification settings - Fork 7
test: retry the check for masking/stopping - it may take several seconds to complete #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
richm
merged 1 commit into
linux-system-roles:main
from
richm:test-ensure-retry-when-masking
Jan 8, 2026
Merged
test: retry the check for masking/stopping - it may take several seconds to complete #120
richm
merged 1 commit into
linux-system-roles:main
from
richm:test-ensure-retry-when-masking
Jan 8, 2026
Conversation
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
…nds to complete retry the check for masking/stopping - it may take several seconds for the unit to be masked and to be stopped Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds retry logic around checking a systemd unit’s masked/stopped state in the basic tests so the test tolerates the delay before the unit reaches its final state. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- The
conditionvariable is defined usingtest_unit_statewithin the same task that registerstest_unit_state, which won’t be available at variable-evaluation time; consider inlining the expression directly inuntil/failed_when(e.g.until: test_unit_state.stdout is search(...)), or moving the condition into a separate task. - Using both
until: conditionandfailed_when: not conditionis redundant; you can rely onuntilalone (dropfailed_when) or invert the condition and keep only one mechanism to simplify the task logic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `condition` variable is defined using `test_unit_state` within the same task that registers `test_unit_state`, which won’t be available at variable-evaluation time; consider inlining the expression directly in `until`/`failed_when` (e.g. `until: test_unit_state.stdout is search(...)`), or moving the condition into a separate task.
- Using both `until: condition` and `failed_when: not condition` is redundant; you can rely on `until` alone (drop `failed_when`) or invert the condition and keep only one mechanism to simplify the task logic.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
[citest] |
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.
retry the check for masking/stopping - it may take several seconds for the unit to be
masked and to be stopped
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Tests: