hrm saucelabs and travis are tripping

gateway-timeout-during-tests
John McLear 2020-05-27 14:56:59 +00:00
parent 9e4fb90d8a
commit 289e24a0a1
1 changed files with 40 additions and 40 deletions

View File

@ -18,55 +18,55 @@ var sauceTestWorker = async.queue(function (testSettings, callback) {
testSettings["public"] = true; testSettings["public"] = true;
testSettings["build"] = process.env.GIT_HASH; testSettings["build"] = process.env.GIT_HASH;
// we wait 10 seconds here with the hope it was enough time for the minified files to be built etc.
setTimeout(function(){ setTimeout(function(){
browser.init(testSettings).get("http://localhost:9001/tests/frontend/", function(){
var url = "https://saucelabs.com/jobs/" + browser.sessionID;
console.log("Remote sauce test '" + name + "' started! " + url);
browser.init(testSettings).get("http://localhost:9001/tests/frontend/", function(){ //tear down the test excecution
var url = "https://saucelabs.com/jobs/" + browser.sessionID; var stopSauce = function(success){
console.log("Remote sauce test '" + name + "' started! " + url); getStatusInterval && clearInterval(getStatusInterval);
clearTimeout(timeout);
//tear down the test excecution browser.quit();
var stopSauce = function(success){
getStatusInterval && clearInterval(getStatusInterval);
clearTimeout(timeout);
browser.quit(); if(!success){
allTestsPassed = false;
}
if(!success){ var testResult = knownConsoleText.replace(/\[red\]/g,'\x1B[31m').replace(/\[yellow\]/g,'\x1B[33m')
allTestsPassed = false; .replace(/\[green\]/g,'\x1B[32m').replace(/\[clear\]/g, '\x1B[39m');
testResult = testResult.split("\\n").map(function(line){
return "[" + testSettings.browserName + (testSettings.version === "" ? '' : (" " + testSettings.version)) + "] " + line;
}).join("\n");
console.log(testResult);
console.log("Remote sauce test '" + name + "' finished! " + url);
callback();
} }
var testResult = knownConsoleText.replace(/\[red\]/g,'\x1B[31m').replace(/\[yellow\]/g,'\x1B[33m') //timeout for the case the test hangs
.replace(/\[green\]/g,'\x1B[32m').replace(/\[clear\]/g, '\x1B[39m'); var timeout = setTimeout(function(){
testResult = testResult.split("\\n").map(function(line){ stopSauce(false);
return "[" + testSettings.browserName + (testSettings.version === "" ? '' : (" " + testSettings.version)) + "] " + line; }, 60000 * 10);
}).join("\n");
console.log(testResult); var knownConsoleText = "";
console.log("Remote sauce test '" + name + "' finished! " + url); var getStatusInterval = setInterval(function(){
browser.eval("$('#console').text()", function(err, consoleText){
if(!consoleText || err){
return;
}
knownConsoleText = consoleText;
callback(); if(knownConsoleText.indexOf("FINISHED") > 0){
} var success = knownConsoleText.indexOf("FAILED") === -1;
stopSauce(success);
//timeout for the case the test hangs }
var timeout = setTimeout(function(){ });
stopSauce(false); }, 5000);
}, 60000 * 10); });
var knownConsoleText = "";
var getStatusInterval = setInterval(function(){
browser.eval("$('#console').text()", function(err, consoleText){
if(!consoleText || err){
return;
}
knownConsoleText = consoleText;
if(knownConsoleText.indexOf("FINISHED") > 0){
var success = knownConsoleText.indexOf("FAILED") === -1;
stopSauce(success);
}
});
}, 5000);
});
}, 10000); }, 10000);