Skip to content

Commit ee2ee6d

Browse files
committed
use timeout for wait condition as well
1 parent 86c73ee commit ee2ee6d

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

packages/compass-e2e-tests/tests/atlas-cloud/global-writes.test.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ type GeoShardingFormData = {
1515

1616
type GeoShardingStatus = 'UNSHARDED' | 'SHARDING' | 'SHARD_KEY_CORRECT';
1717

18+
const WEBDRIVER_TIMEOUT = 1000 * 60 * 20;
19+
const MOCHA_TIMEOUT = WEBDRIVER_TIMEOUT * 1.2;
20+
1821
async function createGeoShardKey(
1922
browser: CompassBrowser,
2023
formData: GeoShardingFormData
@@ -39,12 +42,15 @@ async function waitForGlobalWritesStatus(
3942
browser: CompassBrowser,
4043
nextStatus: GeoShardingStatus
4144
) {
42-
await browser.waitUntil(async () => {
43-
const content = await browser.$(
44-
Selectors.GlobalWrites.tabStatus(nextStatus)
45-
);
46-
return await content.isDisplayed();
47-
});
45+
await browser.waitUntil(
46+
async () => {
47+
const content = await browser.$(
48+
Selectors.GlobalWrites.tabStatus(nextStatus)
49+
);
50+
return await content.isDisplayed();
51+
},
52+
{ timeout: WEBDRIVER_TIMEOUT }
53+
);
4854
}
4955

5056
describe('Global writes', function () {
@@ -53,7 +59,7 @@ describe('Global writes', function () {
5359

5460
beforeEach(async function () {
5561
// Sharding a collection takes a bit longer
56-
this.timeout(1000 * 60 * 20);
62+
this.timeout(MOCHA_TIMEOUT);
5763
compass = await init(this.test?.fullTitle());
5864
browser = compass.browser;
5965
await browser.setupDefaultConnections();

0 commit comments

Comments
 (0)