Skip to content

fix: wait for drop index modal to show up in e2e tests COMPASS-10525#7910

Merged
mabaasit merged 3 commits intomainfrom
unflake-drop-index-modal-not-showing
Mar 30, 2026
Merged

fix: wait for drop index modal to show up in e2e tests COMPASS-10525#7910
mabaasit merged 3 commits intomainfrom
unflake-drop-index-modal-not-showing

Conversation

@mabaasit
Copy link
Copy Markdown
Collaborator

supports creating and dropping indexes test has been flaky on macOS 15 (arm64). The drop index modal does not show up on click of delete button. I think its due to tooltip showing on hover.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@mabaasit mabaasit requested a review from a team as a code owner March 25, 2026 13:17
@mabaasit mabaasit requested review from Copilot and ivandevp March 25, 2026 13:17
@github-actions github-actions bot added the fix label Mar 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Stabilizes the Compass E2E helper that drops an index by making the “open Drop Index modal” step more resilient to UI timing/hover interactions that can cause flakiness on macOS.

Changes:

  • Retries the hover + “drop index” button click until the Drop Index modal is detected as open.

Comment on lines +13 to +20
await browser.waitUntil(async () => {
await browser.hover(indexComponentSelector);
await browser.clickVisible(
`${indexComponentSelector} ${Selectors.IndexesTableDropIndexButton}`
);
// Check if modal opened successfully
return await browser.isModalOpen(Selectors.DropIndexModal);
});
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

browser.waitUntil here relies on the global default timeout and will likely produce a generic timeout error if the modal never opens, which can make CI debugging harder. Consider passing an explicit timeout (aligned with other UI waits in this repo) and a helpful timeoutMsg describing that we couldn't open the Drop Index modal after clicking the drop button.

Suggested change
await browser.waitUntil(async () => {
await browser.hover(indexComponentSelector);
await browser.clickVisible(
`${indexComponentSelector} ${Selectors.IndexesTableDropIndexButton}`
);
// Check if modal opened successfully
return await browser.isModalOpen(Selectors.DropIndexModal);
});
await browser.waitUntil(
async () => {
await browser.hover(indexComponentSelector);
await browser.clickVisible(
`${indexComponentSelector} ${Selectors.IndexesTableDropIndexButton}`
);
// Check if modal opened successfully
return await browser.isModalOpen(Selectors.DropIndexModal);
},
{
timeout: 10000,
timeoutMsg: `Timed out waiting for Drop Index modal to open after clicking drop button for index "${indexName}".`,
}
);

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +20
await browser.waitUntil(async () => {
await browser.hover(indexComponentSelector);
await browser.clickVisible(
`${indexComponentSelector} ${Selectors.IndexesTableDropIndexButton}`
);
// Check if modal opened successfully
return await browser.isModalOpen(Selectors.DropIndexModal);
});
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

In this waitUntil block, the click is executed before checking whether the Drop Index modal is already open. If the modal opens between retries, the next iteration can still try to click the (now covered) drop button, which can reintroduce flakiness via click interception. Consider checking isModalOpen(Selectors.DropIndexModal) first and returning true before attempting hover/click on subsequent retries.

Copilot uses AI. Check for mistakes.
@mabaasit mabaasit changed the title fix: wait for drop index modal to show up in e2e tests fix: wait for drop index modal to show up in e2e tests COMPASS-10525 Mar 30, 2026
@mabaasit mabaasit added the no release notes Fix or feature not for release notes label Mar 30, 2026
@mabaasit mabaasit merged commit d138601 into main Mar 30, 2026
77 of 84 checks passed
@mabaasit mabaasit deleted the unflake-drop-index-modal-not-showing branch March 30, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants