Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(search-indexes): increase timeout COMPASS-7303 #4959

Merged
merged 8 commits into from
Oct 12, 2023
Merged
Changes from 6 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
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;
mabaasit marked this conversation as resolved.
Show resolved Hide resolved

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(360_000);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You're hardcoding this one but have the other one as a variable at the top. Would probably make sense to have them both as vars at the top then you can explain it all in one comment.

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
Loading