Skip to content

Commit

Permalink
test(search-indexes): increase timeout COMPASS-7303 (mongodb-js#4959)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabaasit authored Oct 12, 2023
1 parent e5f2053 commit 80ce9c1
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/compass-e2e-tests/tests/search-indexes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const INDEX_DEFINITION = JSON.stringify({
},
});

// The current timeout (2mins) is not enough for the search indexes to be created
// and be queryable on Atlas. So we are increasing the timeout to 4mins.
// This can not be more than mocha timeout.
const WAIT_TIMEOUT = 240_000;
const MOCHA_TIMEOUT = 360_000;

function getRandomNumber() {
return Math.floor(Math.random() * 2 ** 20);
}
Expand Down Expand Up @@ -113,8 +119,9 @@ async function dropSearchIndex(browser: CompassBrowser, indexName: string) {
await browser.clickVisible(Selectors.ConfirmationModalConfirmButton());
await modal.waitForDisplayed({ reverse: true });

await browser.waitUntil(async () => {
return await indexRow.waitForExist({ reverse: true });
await indexRow.waitForExist({
reverse: true,
timeout: WAIT_TIMEOUT,
});
}

Expand All @@ -125,7 +132,7 @@ async function verifyIndexDetails(
) {
const indexRowSelector = Selectors.searchIndexRow(indexName);
const indexRow = await browser.$(indexRowSelector);
await indexRow.waitForDisplayed();
await indexRow.waitForDisplayed({ timeout: WAIT_TIMEOUT });
await browser.hover(indexRowSelector);
await browser.clickVisible(Selectors.searchIndexExpandButton(indexName));

Expand Down Expand Up @@ -228,6 +235,8 @@ describe('Search Indexes', function () {

for (const { name, connectionString } of connectionsWithSearchSupport) {
context(`supports search indexes in ${name}`, function () {
// Set the mocha timeout to 6mins to accomodate the 4mins wait timeout
this.timeout(MOCHA_TIMEOUT);
before(function () {
if (!connectionString) {
return this.skip();
Expand Down Expand Up @@ -303,7 +312,7 @@ describe('Search Indexes', function () {

const indexRowSelector = Selectors.searchIndexRow(indexName);
const indexRow = await browser.$(indexRowSelector);
await indexRow.waitForDisplayed();
await indexRow.waitForDisplayed({ timeout: WAIT_TIMEOUT });

await browser.hover(indexRowSelector);

Expand Down

0 comments on commit 80ce9c1

Please sign in to comment.