Skip to content

waiting for alert message after host delete - #1891

Merged
LadislavVasina1 merged 1 commit into
SatelliteQE:masterfrom
amolpati30:wait_for_alert_msg_after_host_delete
Jun 24, 2025
Merged

waiting for alert message after host delete#1891
LadislavVasina1 merged 1 commit into
SatelliteQE:masterfrom
amolpati30:wait_for_alert_msg_after_host_delete

Conversation

@amolpati30

@amolpati30 amolpati30 commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

This test tests.foreman.ui.test_computeresource_azurerm.test_positive_end_to_end_azurerm_ft_host_provision is inconsistent — it passes sometimes and fails other times. In Azure, deleting a host take some time, so I'm adding a check to look for the 'delete' message to avoid failures.

Summary by Sourcery

Add explicit wait for the success alert message after deleting a host to prevent intermittent test failures

Bug Fixes:

  • Fix intermittent test failures in host deletion by waiting for the deletion success alert

Enhancements:

  • Introduce a wait_for wrapper with a 120-second timeout to assert the delete confirmation message

@amolpati30 amolpati30 added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked Automatically merge the PR is PRT and all checks are passing Stream 6.15.z 6.16.z 6.17.z labels Jun 23, 2025
@sourcery-ai

sourcery-ai Bot commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR enhances the host deletion flow by introducing an explicit wait for the 'Successfully deleted' flash message with a 120-second timeout to address timing inconsistencies in Azure.

Sequence diagram for updated host deletion flow

sequenceDiagram
    actor Tester
    participant HostEntity as Host Entity
    participant View as UI View
    participant Browser
    Tester->>HostEntity: delete(entity_name)
    HostEntity->>View: search(entity_name)
    HostEntity->>View: table.row(name=entity_name)['Actions'].widget.fill('Delete')
    HostEntity->>Browser: handle_alert()
    HostEntity->>View: wait_for(flash.assert_message('Successfully deleted ...'), timeout=120)
    HostEntity->>View: flash.assert_no_error()
    HostEntity->>View: flash.dismiss()
Loading

File-Level Changes

Change Details Files
Wait for deletion success alert before proceeding in host.delete
  • Inserted wait_for lambda to poll for the 'Successfully deleted {entity_name}' flash message
  • Set timeout to 120 seconds to accommodate Azure host deletion delays
airgun/entities/host.py

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @amolpati30 - I've reviewed your changes and they look great!


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.

@amolpati30
amolpati30 force-pushed the wait_for_alert_msg_after_host_delete branch from e52f214 to 393c285 Compare June 23, 2025 19:06
@amolpati30

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_computeresource_azurerm.py -k test_positive_end_to_end_azurerm_ft_host_provision

@sambible sambible left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems reasonable, but these always look like reasonable changes on paper, if PRT proves it out I'm fine with merging.

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jun 23, 2025

@LadislavVasina1 LadislavVasina1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK, @amolpati30 keep an eye on the automation results too

@LadislavVasina1
LadislavVasina1 merged commit 83801dc into SatelliteQE:master Jun 24, 2025
10 checks passed
github-actions Bot pushed a commit that referenced this pull request Jun 24, 2025
github-actions Bot pushed a commit that referenced this pull request Jun 24, 2025
github-actions Bot pushed a commit that referenced this pull request Jun 24, 2025
Gauravtalreja1 pushed a commit that referenced this pull request Jul 1, 2025
Gauravtalreja1 pushed a commit that referenced this pull request Jul 7, 2025
Gauravtalreja1 pushed a commit that referenced this pull request Jul 7, 2025
(cherry picked from commit 83801dc)

Co-authored-by: amolpati30 <151733635+amolpati30@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.15.z 6.16.z 6.17.z AutoMerge_Cherry_Picked Automatically merge the PR is PRT and all checks are passing CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants