Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/compass-e2e-tests/helpers/commands/drop-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ export async function dropIndex(
const indexComponent = browser.$(indexComponentSelector);
await indexComponent.waitForDisplayed();

await browser.hover(indexComponentSelector);
await browser.clickVisible(
`${indexComponentSelector} ${Selectors.IndexesTableDropIndexButton}`
);
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);
});
Comment on lines +13 to +20
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
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.

await browser.waitForOpenModal(Selectors.DropIndexModal);

Expand Down
Loading