Skip to content

Commit ea60db4

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 8d509be commit ea60db4

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
@@ -68,10 +68,8 @@ module.exports = config => {
6868
video: false,
6969
},
7070

71-
browserDisconnectTimeout: 180000,
72-
browserDisconnectTolerance: 3,
71+
browserDisconnectTolerance: 1,
7372
browserNoActivityTimeout: 300000,
74-
captureTimeout: 180000,
7573

7674
browsers: ['ChromeHeadlessLocal'],
7775
singleRun: false,
@@ -126,6 +124,15 @@ module.exports = config => {
126124
config.reporters.push('saucelabs');
127125
}
128126

127+
// If the test platform is not "local", browsers are launched externally and can take
128+
// up more time to capture. Also the connection can be flaky and therefore needs a
129+
// higher disconnect timeout.
130+
if (testPlatform !== 'local') {
131+
config.browserDisconnectTimeout = 180000;
132+
config.browserDisconnectTolerance = 3;
133+
config.captureTimeout = 180000;
134+
}
135+
129136
const platformBrowsers = platformMap[testPlatform];
130137
const browserInstanceChunks = splitBrowsersIntoInstances(
131138
platformBrowsers, maxParallelContainerInstances);

0 commit comments

Comments
 (0)