From 7baeaa797b19da2d2998f0d26f6fede3c8a13714 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 19 Mar 2019 19:21:39 +0100 Subject: [PATCH] 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. --- test/karma-browsers.json | 6 ------ test/karma.conf.js | 13 ++++++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/karma-browsers.json b/test/karma-browsers.json index 0374ffbe3db..8763193722d 100644 --- a/test/karma-browsers.json +++ b/test/karma-browsers.json @@ -12,12 +12,6 @@ "--no-sandbox" ] }, - "FirefoxHeadless": { - "base": "Firefox", - "flags": [ - "-headless" - ] - }, "SAUCELABS_CHROME": { "base": "SauceLabs", "browserName": "chrome", diff --git a/test/karma.conf.js b/test/karma.conf.js index a8f60e6670e..a09d66cd45b 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -81,10 +81,8 @@ module.exports = config => { video: false, }, - browserDisconnectTimeout: 180000, - browserDisconnectTolerance: 3, + browserDisconnectTolerance: 1, browserNoActivityTimeout: 300000, - captureTimeout: 180000, browsers: ['ChromeHeadlessLocal'], singleRun: false, @@ -139,6 +137,15 @@ module.exports = config => { config.reporters.push('saucelabs'); } + // If the test platform is not "local", browsers are launched externally and can take + // up more time to capture. Also the connection can be flaky and therefore needs a + // higher disconnect timeout. + if (testPlatform !== 'local') { + config.browserDisconnectTimeout = 180000; + config.browserDisconnectTolerance = 3; + config.captureTimeout = 180000; + } + const platformBrowsers = platformMap[testPlatform]; const browserInstanceChunks = splitBrowsersIntoInstances( platformBrowsers, maxParallelContainerInstances);