Retry the timed out tests for a number of times

This commit is contained in:
Amin Yahyaabadi 2020-08-30 03:38:33 -05:00
parent 4ef17f67ff
commit 5fabcbb4f7

View File

@ -102,16 +102,15 @@ function spawnTest(executablePath, testArguments, options, callback, testName, f
// on close
cp.on('close', exitCode => {
if (exitCode !== 0) {
console.log(`##[error] Tests for ${testName} failed.`.red)
console.log(stderrOutput)
}
if (finalize) { finalize() } // if finalizer provided
callback(null, {
exitCode,
step: testName,
testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`,
})
if (exitCode !== 0) {
retryOrFailTest(stderrOutput, executablePath, testArguments, options, callback, testName, finalize)
}
})
}