Skip to content

test: check for failed rhcd service due to el8 bug#280

Merged
richm merged 1 commit into
linux-system-roles:mainfrom
richm:test-check-rhcd-stopped
May 13, 2026
Merged

test: check for failed rhcd service due to el8 bug#280
richm merged 1 commit into
linux-system-roles:mainfrom
richm:test-check-rhcd-stopped

Conversation

@richm
Copy link
Copy Markdown
Contributor

@richm richm commented May 13, 2026

Due to https://access.redhat.com/solutions/7106551 the test will sometimes
fail on EL8 when disabling remediation. Add a check to see if the service
has stopped with a failure.

Signed-off-by: Rich Megginson rmeggins@redhat.com

Summary by Sourcery

Handle intermittent EL8 remediation shutdown failures in insights remediation tests by relaxing service status assertions and adding service status debugging.

Bug Fixes:

  • Allow rhcd/yggdrasil remediation disablement tests to pass when the service stops with a failed state on EL8 due to a known systemd issue.

Tests:

  • Log yggdrasil_systemd_service status via debug output and suppress service_facts logging at lower verbosity levels in insights remediation tests.

Due to https://access.redhat.com/solutions/7106551 the test will sometimes
fail on EL8 when disabling remediation.  Add a check to see if the service
has stopped with a failure.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm richm requested a review from ptoscano as a code owner May 13, 2026 14:28
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 13, 2026

Reviewer's Guide

Updates the Ansible insights remediation tests to log service facts for yggdrasil/rhcd and to tolerate a specific EL8 bug where stopping the remediation service can leave it in a failed state instead of disabled.

File-Level Changes

Change Details Files
Enhance service_facts collection and add debug visibility for yggdrasil_systemd_service state.
  • Add no_log guard to service_facts collection based on ansible_verbosity.
  • Introduce debug task to display the yggdrasil_systemd_service entry from ansible_facts.services when remediation should be enabled.
  • Introduce debug task to display the yggdrasil_systemd_service entry when remediation should be disabled.
tests/tests_insights_remediation.yml
Relax remediation-disabled assertion to handle EL8 bug where rhcd may be stopped with a failed status instead of disabled.
  • Replace direct indexing into ansible_facts.services with safe .get() access into a temporary __info dict.
  • Derive __status and __state helper variables from __info for clearer assertions.
  • Change the remediation-disabled assert to accept either status=='disabled' or a combination of state=='stopped' and status=='failed', and to fail if service info is missing.
  • Document the EL8-specific rhcd shutdown failure and link the related Red Hat solution in comments.
tests/tests_insights_remediation.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a 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 no_log parameter on the Get service_facts tasks appears to be indented as if it were a module argument; it should be at the same level as service_facts so Ansible treats it as a task-level attribute.
  • You now have nearly identical Get service_facts + debug blocks for the enabled and disabled checks; consider extracting this into a reusable task (e.g., via include_tasks with variables) to avoid duplication and keep future changes to the service lookup logic in one place.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `no_log` parameter on the `Get service_facts` tasks appears to be indented as if it were a module argument; it should be at the same level as `service_facts` so Ansible treats it as a task-level attribute.
- You now have nearly identical `Get service_facts` + debug blocks for the enabled and disabled checks; consider extracting this into a reusable task (e.g., via `include_tasks` with variables) to avoid duplication and keep future changes to the service lookup logic in one place.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@richm
Copy link
Copy Markdown
Contributor Author

richm commented May 13, 2026

[citest]

@richm richm merged commit bfe9215 into linux-system-roles:main May 13, 2026
36 checks passed
@richm richm deleted the test-check-rhcd-stopped branch May 13, 2026 15:43
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.

1 participant