Skip to content

[MISC] Fix wrong waiting logic in self-healing test, fix misuses of wait_for_unit_status (backport to 8.0/edge)#265

Open
Copilot wants to merge 2 commits into8.0/edgefrom
copilot/backport-pr-264-to-8-0-edge
Open

[MISC] Fix wrong waiting logic in self-healing test, fix misuses of wait_for_unit_status (backport to 8.0/edge)#265
Copilot wants to merge 2 commits into8.0/edgefrom
copilot/backport-pr-264-to-8-0-edge

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Backport of #264 to the 8.0/edge branch.

Issue

The self-healing setup crash test has always been broken: it was checking the app status instead of the workload status when waiting for units to enter the "waiting" phase. Additionally, several roles tests had misuses of wait_for_unit_status where the returned lambda was not being called with status.

Solution

  • test_self_healing_setup_crash.py:

    • Added wait_for_unit_status to imports
    • Added trust=True to the juju.deploy() call
    • Fixed the waiting logic to check per-unit workload status instead of app-level status
    • Added successes=1 to mitigate race conditions if units clear the "waiting" phase too quickly
  • test_database_dba_role.py, test_instance_dba_role.py, test_instance_roles.py: Fixed misuses of wait_for_unit_status — the function returns a lambda that must be called with (status).

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

…it_status misuses

Agent-Logs-Url: https://github.com/canonical/mysql-operators/sessions/9dc045f5-e998-405f-918e-299a250ed5ef

Co-authored-by: astrojuanlu <316517+astrojuanlu@users.noreply.github.com>
@astrojuanlu

This comment was marked as outdated.

Copilot AI force-pushed the copilot/backport-pr-264-to-8-0-edge branch from fb69108 to 33d0f4d Compare April 23, 2026 12:04

This comment was marked as outdated.

@astrojuanlu

This comment was marked as off-topic.

@astrojuanlu astrojuanlu changed the base branch from 8.4/edge to 8.0/edge April 23, 2026 12:14
@astrojuanlu astrojuanlu added the not bug or enhancement PR is not 'bug' or 'enhancement'. For release notes label Apr 23, 2026
@github-actions github-actions Bot added the Libraries: Out of sync The charm libs used are out-of-sync label Apr 23, 2026
@astrojuanlu astrojuanlu marked this pull request as ready for review April 23, 2026 14:36
Copy link
Copy Markdown
Contributor

@sinclert-canonical sinclert-canonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as in the 8.4/edge one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Libraries: Out of sync The charm libs used are out-of-sync not bug or enhancement PR is not 'bug' or 'enhancement'. For release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants