Auto retry twice if test failed
This commit is contained in:
@@ -65,7 +65,7 @@ var launchTestController = function(req, res, testQueue) {
|
||||
|
||||
], function(err) {
|
||||
if (err) {
|
||||
console.log('An error occured while launching the phantomas test : ', err);
|
||||
console.log('An error occured in the phantomas test: ', err);
|
||||
|
||||
fs.writeFile(phantomasResultsPath, JSON.stringify({url: url, error: err}, null, 4), function(err) {
|
||||
if (err) {
|
||||
@@ -73,6 +73,7 @@ var launchTestController = function(req, res, testQueue) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
testQueue.testFailed(testId);
|
||||
} else {
|
||||
testQueue.testComplete(testId);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,13 @@ var waitingQueueSocket = function(socket, testQueue) {
|
||||
}
|
||||
});
|
||||
|
||||
testQueue.on('testFailed', function(id) {
|
||||
if (testId === id) {
|
||||
socket.emit('failed');
|
||||
console.log('Sending failed event to test id ' + testId);
|
||||
}
|
||||
});
|
||||
|
||||
testQueue.on('queueMoving', function() {
|
||||
var positionInQueue = testQueue.indexOf(testId);
|
||||
if (positionInQueue >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user