Skip to content

Commit 0193232

Browse files
Increased test timeouts for SauceLabs
1 parent 571c27c commit 0193232

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

karma.conf.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ var baseConfig = {
1616

1717
// Test Fixtures
1818
'tests/fixtures/**/*.js',
19-
{pattern: 'tests/files/**', included: false, served: true},
2019

2120
// Tests
2221
'tests/specs/**/*.js',
@@ -200,12 +199,17 @@ function configureSauceLabs(config) {
200199

201200
config.reporters.push('saucelabs');
202201
config.browsers = Object.keys(config.customLaunchers);
202+
config.captureTimeout = 60000;
203+
config.browserDisconnectTimeout = 15000;
204+
config.browserNoActivityTimeout = 15000;
205+
// config.logLevel = 'debug';
203206

204-
// Certain tests seem to always fail on SauceLabs.
205-
// They pass fine on local browsers, so I'm not sure why they fail when run remotely.
207+
// The following tests tend to fail on SauceLabs,
208+
// probably due to zero-byte files and special characters in the paths.
206209
// So, exclude these tests when running on SauceLabs.
207-
baseConfig.exclude = [
208-
'tests/specs/__({[ ! % & $ # @ ` ~ ,)}]__/**',
210+
config.exclude = [
211+
'tests/fixtures/config.js',
212+
'tests/specs/__*/**',
209213
'tests/specs/blank/**',
210214
'tests/specs/unknown/**'
211215
];

tests/specs/callbacks.spec.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
'use strict';
22

33
describe('Callback & Promise syntax', function() {
4+
// NOTE: This delay is so high because TravisCI and SauceLabs,
5+
// both of which are VERY SLOW
6+
var delay = 2000;
7+
48
beforeEach(function() {
5-
// These tests all have a 200ms delay,
6-
// to ensure that all callbacks and promises are called.
7-
this.currentTest.slow(500);
9+
// These tests all have a delay, to ensure that all callbacks and promises are called.
10+
// So we need to increase the test timeouts
11+
this.currentTest.timeout(delay * 2);
12+
this.currentTest.slow(delay * 2);
813
});
914

1015
['parse', 'resolve', 'dereference', 'bundle'].forEach(function(method) {
@@ -50,7 +55,7 @@ describe('Callback & Promise syntax', function() {
5055
catch (e) {
5156
done(e)
5257
}
53-
}, 200);
58+
}, delay);
5459
}
5560
}
5661

@@ -89,7 +94,7 @@ describe('Callback & Promise syntax', function() {
8994
catch (e) {
9095
done(e)
9196
}
92-
}, 200);
97+
}, delay);
9398
}
9499
}
95100
});

0 commit comments

Comments
 (0)