Skip to content

Commit 2e18640

Browse files
devversionandrewseguin
authored andcommitted
build: decrease karma timeouts for local browsers (#15540)
Currently the timeouts which have been adjusted for a flaky browser connection are also used for local browser runs. This is problematic as local browsers which do not capture properly still wait multiple minutes, while the browser can just be restarted without hitting any rate limit. Additionally removes the custom `FirefoxHeadless` browser because the `karma-firefox-launcher` also provides the `FirefoxHeadless` browser configuration.
1 parent 45c2fb2 commit 2e18640

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

test/karma-browsers.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
"--no-sandbox"
1313
]
1414
},
15-
"FirefoxHeadless": {
16-
"base": "Firefox",
17-
"flags": [
18-
"-headless"
19-
]
20-
},
2115
"SAUCELABS_CHROME": {
2216
"base": "SauceLabs",
2317
"browserName": "chrome",

test/karma.conf.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,8 @@ module.exports = config => {
7373
video: false,
7474
},
7575

76-
browserDisconnectTimeout: 180000,
77-
browserDisconnectTolerance: 3,
76+
browserDisconnectTolerance: 1,
7877
browserNoActivityTimeout: 300000,
79-
captureTimeout: 180000,
8078

8179
browsers: ['ChromeHeadlessLocal'],
8280
singleRun: false,
@@ -131,6 +129,15 @@ module.exports = config => {
131129
config.reporters.push('saucelabs');
132130
}
133131

132+
// If the test platform is not "local", browsers are launched externally and can take
133+
// up more time to capture. Also the connection can be flaky and therefore needs a
134+
// higher disconnect timeout.
135+
if (testPlatform !== 'local') {
136+
config.browserDisconnectTimeout = 180000;
137+
config.browserDisconnectTolerance = 3;
138+
config.captureTimeout = 180000;
139+
}
140+
134141
const platformBrowsers = platformMap[testPlatform];
135142
const browserInstanceChunks = splitBrowsersIntoInstances(
136143
platformBrowsers, maxParallelContainerInstances);

0 commit comments

Comments
 (0)