Skip to content

Fix alerting flaky failing tests - #2131

Merged
rishabh6788 merged 1 commit into
opensearch-project:mainfrom
vikhy-aws:main
Aug 2, 2026
Merged

Fix alerting flaky failing tests#2131
rishabh6788 merged 1 commit into
opensearch-project:mainfrom
vikhy-aws:main

Conversation

@vikhy-aws

Copy link
Copy Markdown
Contributor

Description

Fix failing flaky tests in alerting.

Issues Resolved

opensearch-project/alerting-dashboards-plugin#1492

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Register intercept before triggering actions

The cy.intercept is registered after the page has already loaded and interactions
have occurred, and immediately before the click that triggers the request. To ensure
the intercept reliably captures the PUT request, register it before the actions that
could trigger navigation/requests, ideally near the start of the test flow.

cypress/integration/plugins/alerting-dashboards-plugin/query_level_monitor_spec.js [383-386]

+// Click save button and wait for the monitor update API to complete
+cy.intercept('PUT', '**/api/alerting/monitors/*').as('saveMonitor');
+cy.get('button').contains('Save').last().click({ force: true });
+cy.wait('@saveMonitor', { timeout: ALERTING_PLUGIN_TIMEOUT });
 
-
Suggestion importance[1-10]: 3

__

Why: The suggestion notes a valid Cypress best practice about registering cy.intercept before the action, but since the intercept is registered on the line immediately before the click that triggers the PUT request, it will still work correctly. Additionally, the improved_code is identical to the existing_code, offering no actual change.

Low

@rishabh6788
rishabh6788 merged commit d0a7dc9 into opensearch-project:main Aug 2, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants