Skip to content

Commit 8f56e6f

Browse files
committed
Auto retry for integration tests
1 parent bbbc85c commit 8f56e6f

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

packages/app/integration-tests/browser-tests/browsers.test.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ const hash = require('child_process')
44
.execSync('git rev-parse --short HEAD')
55
.toString();
66

7+
const delay = ms =>
8+
new Promise(resolve => {
9+
setTimeout(() => {
10+
resolve();
11+
}, ms);
12+
});
13+
714
function getCapabilities(browserInfo) {
815
return {
916
...browserInfo,
@@ -77,8 +84,13 @@ usedDescribe('browser-tests', () => {
7784
os_version: '10',
7885
resolution: '1024x768',
7986
};
80-
81-
await testPageWitCapabilities(capabilities);
87+
try {
88+
await testPageWitCapabilities(capabilities);
89+
} catch (e) {
90+
await delay(10000);
91+
// Retry
92+
await testPageWitCapabilities(capabilities);
93+
}
8294
}, 130000);
8395

8496
test('safari', async () => {
@@ -90,8 +102,13 @@ usedDescribe('browser-tests', () => {
90102
os_version: 'High Sierra',
91103
resolution: '1024x768',
92104
};
93-
94-
await testPageWitCapabilities(capabilities);
105+
try {
106+
await testPageWitCapabilities(capabilities);
107+
} catch (e) {
108+
await delay(10000);
109+
// Retry
110+
await testPageWitCapabilities(capabilities);
111+
}
95112
}, 130000);
96113

97114
test.skip('android', async () => {

0 commit comments

Comments
 (0)