Increase timeout to 2 minutes

This commit is contained in:
Gaël Métais
2020-10-06 00:55:29 +02:00
parent 06887003cf
commit de280c23ea
2 changed files with 2 additions and 40 deletions
+1 -39
View File
@@ -31,7 +31,7 @@ var PhantomasWrapper = function() {
var options = {
// Cusomizable options
'timeout': task.options.timeout || 60,
'timeout': task.options.timeout || 120,
'user-agent': (task.options.device === 'desktop') ? 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) YLT Chrome/85.0.4183.121 Safari/537.36' : null,
'tablet': (task.options.device === 'tablet'),
'phone': (task.options.device === 'phone'),
@@ -79,44 +79,6 @@ var PhantomasWrapper = function() {
deferred.reject('Phantomas failed: ' + res.message);
});
/*var process = phantomas(task.url, options, function(err, json, results) {
var errorCode = err ? parseInt(err.message, 10) : null;
debug('Returning from Phantomas with error %s', errorCode);
// Adding some YellowLabTools errors here
if (json && json.metrics && (!json.metrics.javascriptExecutionTree || !json.offenders.javascriptExecutionTree)) {
errorCode = 1001;
}
if (!errorCode && (!json || !json.metrics)) {
errorCode = 1002;
}
// Don't cancel test if it is a timeout and we've got some results
if (errorCode === 252 && json) {
debug('Timeout after ' + options.timeout + ' seconds. But it\'s not a problem, the test is valid.');
errorCode = null;
}
if (errorCode) {
debug('Attempt failed. Error code ' + errorCode);
}
}, function(err, json) {
if (err) {
debug('All ' + triesNumber + ' attemps failed for the test');
deferred.reject(err);
} else {
deferred.resolve(json);
}
});
*/
return deferred.promise;
};
};
+1 -1
View File
@@ -62,7 +62,7 @@
"meow": "5.0.0",
"minimize": "2.2.0",
"parse-color": "1.0.0",
"phantomas": "git://github.com/macbre/phantomas.git#phantomas-v2",
"phantomas": "git://github.com/macbre/phantomas.git#devel",
"ps-node": "0.1.6",
"q": "1.5.1",
"request": "2.88.0",