fix: wait for drop index modal to show up in e2e tests COMPASS-10525#7910
fix: wait for drop index modal to show up in e2e tests COMPASS-10525#7910
Conversation
There was a problem hiding this comment.
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.
| 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); | ||
| }); |
There was a problem hiding this comment.
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.
| 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}".`, | |
| } | |
| ); |
| 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); | ||
| }); |
There was a problem hiding this comment.
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.
supports creating and dropping indexestest 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
Motivation and Context
Open Questions
Dependents
Types of changes