Skip to content

Commit

Permalink
ci: extend default timeout of karma tests for legacy saucelab tests (a…
Browse files Browse the repository at this point in the history
…ngular#42473)

After testing, it seems that the flakyness we are experiencing in our legacy
saucelabs job is caused by timeouts which happen due to the karma server being
unable to serve all of the files needed for the tests fast enough while concurrent
tests are being run.

PR Close angular#42473
  • Loading branch information
josephperrott authored and thePunderWoman committed Jun 3, 2021
1 parent 1684b70 commit ae858c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions karma-js.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

const browserProvidersConf = require('./browser-providers.conf');
const {generateSeed} = require('./tools/jasmine-seed-generator');
const {hostname} = require('os');

// Karma configuration
// Generated on Thu Sep 25 2014 11:52:02 GMT-0700 (PDT)
Expand All @@ -20,6 +21,7 @@ module.exports = function(config) {
random: true,
seed: generateSeed('karma-js.conf'),
},
captureConsole: process.env.CI ? false : true,
},

files: [
Expand Down Expand Up @@ -182,6 +184,8 @@ module.exports = function(config) {
// More context can be found in: https://github.com/angular/angular/pull/35171.
if (process.env.SAUCE_LOCALHOST_ALIAS_DOMAIN) {
conf.hostname = process.env.SAUCE_LOCALHOST_ALIAS_DOMAIN;
} else {
conf.hostname = hostname();
}

if (process.env.KARMA_WEB_TEST_MODE) {
Expand Down
2 changes: 1 addition & 1 deletion test-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Tun on full stack traces in errors to help debugging
Error.stackTraceLimit = Infinity;

jasmine.DEFAULT_TIMEOUT_INTERVAL = 3000;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;

// Cancel Karma's synchronous start,
// we will call `__karma__.start()` later, once all the specs are loaded.
Expand Down

0 comments on commit ae858c0

Please sign in to comment.