tests: Speed up and fix travis (#4453)

Various test runner fixes.
This commit is contained in:
webzwo0i 2020-10-30 11:40:11 +01:00 committed by GitHub
parent b41d9762fa
commit b67c9cc136
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 20 deletions

View file

@ -151,7 +151,7 @@ describe("the test helper", function(){
}, 2000, 100).fail(function(){
// One at the beginning, and 19-20 more depending on whether it's the timeout or the final
// poll that wins at 2000ms.
expect(checks).to.be.greaterThan(17);
expect(checks).to.be.greaterThan(15);
expect(checks).to.be.lessThan(24);
done();
});
@ -243,7 +243,7 @@ describe("the test helper", function(){
// `checks` is expected to be 20 or 21: one at the beginning, plus 19 or 20 more depending on
// whether it's the timeout or the final poll that wins at 2000ms. Margin is added to reduce
// flakiness on slow test machines.
expect(checks).to.be.greaterThan(17);
expect(checks).to.be.greaterThan(15);
expect(checks).to.be.lessThan(24);
});
});

View file

@ -10,6 +10,10 @@ var config = {
}
var allTestsPassed = true;
// overwrite the default exit code
// in case not all worker can be run (due to saucelabs limits), `queue.drain` below will not be called
// and the script would silently exit with error code 0
process.exitCode = 1;
var sauceTestWorker = async.queue(function (testSettings, callback) {
var browser = wd.promiseChainRemote(config.host, config.port, config.username, config.accessKey);
@ -53,13 +57,13 @@ var sauceTestWorker = async.queue(function (testSettings, callback) {
}
/**
* timeout if a test hangs or the job exceeds 9.5 minutes
* timeout if a test hangs or the job exceeds 14.5 minutes
* It's necessary because if travis kills the saucelabs session due to inactivity, we don't get any output
* @todo this should be configured in testSettings, see https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-Timeouts
*/
var timeout = setTimeout(function(){
stopSauce(false,true);
}, 570000); // travis timeout is 10 minutes, set this to a slightly lower value
}, 870000); // travis timeout is 15 minutes, set this to a slightly lower value
var knownConsoleText = "";
var getStatusInterval = setInterval(function(){