@@ -15,6 +15,9 @@ type GeoShardingFormData = {
1515
1616type GeoShardingStatus = 'UNSHARDED' | 'SHARDING' | 'SHARD_KEY_CORRECT' ;
1717
18+ const WEBDRIVER_TIMEOUT = 1000 * 60 * 20 ;
19+ const MOCHA_TIMEOUT = WEBDRIVER_TIMEOUT * 1.2 ;
20+
1821async 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
5056describe ( '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