Skip to content

Commit 7baeaa7

Browse files
devversionandrewseguin
authored andcommitted
build: decrease karma timeouts for local browsers (#15539)
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 eb5eed1 commit 7baeaa7

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
@@ -81,10 +81,8 @@ module.exports = config => {
8181
video: false,
8282
},
8383

84-
browserDisconnectTimeout: 180000,
85-
browserDisconnectTolerance: 3,
84+
browserDisconnectTolerance: 1,
8685
browserNoActivityTimeout: 300000,
87-
captureTimeout: 180000,
8886

8987
browsers: ['ChromeHeadlessLocal'],
9088
singleRun: false,
@@ -139,6 +137,15 @@ module.exports = config => {
139137
config.reporters.push('saucelabs');
140138
}
141139

140+
// If the test platform is not "local", browsers are launched externally and can take
141+
// up more time to capture. Also the connection can be flaky and therefore needs a
142+
// higher disconnect timeout.
143+
if (testPlatform !== 'local') {
144+
config.browserDisconnectTimeout = 180000;
145+
config.browserDisconnectTolerance = 3;
146+
config.captureTimeout = 180000;
147+
}
148+
142149
const platformBrowsers = platformMap[testPlatform];
143150
const browserInstanceChunks = splitBrowsersIntoInstances(
144151
platformBrowsers, maxParallelContainerInstances);

0 commit comments

Comments
 (0)