chore: remove screenshot timeout check (#7206)

Removes the screenshot timeout check, which will cancel the screenshot diff if the last action took longer than 6 minutes. Travis CI will automatically cancel the job if there was no console output for 10 minutes.
This commit is contained in:
Paul Gschwendtner
2017-09-29 00:39:40 +02:00
committed by Jeremy Elbourn
parent 3982cc8b60
commit 1ac3fd25c9
-18
View File
@@ -34,12 +34,6 @@ const FIREBASE_IMAGE = `${TEMP_FOLDER}/screenshot/images`;
const FIREBASE_DATA_GOLDENS = `screenshot/goldens`;
const FIREBASE_STORAGE_GOLDENS = 'goldens';
/** Time in ms until the process will be exited if the last action took too long (6 minutes). */
const lastActionTimeout = 1000 * 60 * 6;
/** Time in ms that specifies how often the last action should be checked (45 seconds). */
const lastActionRefreshInterval = 1000 * 45;
/** Task which upload screenshots generated from e2e test. */
task('screenshots', () => {
const prNumber = process.env['TRAVIS_PULL_REQUEST'];
@@ -52,16 +46,6 @@ task('screenshots', () => {
const database = firebaseApp.database();
let lastActionTime = Date.now();
// If the last action of the task takes longer than 6 minutes, close the firebase connection.
const timeoutId = setInterval(() => {
if (lastActionTime + lastActionTimeout <= Date.now()) {
clearTimeout(timeoutId);
console.error('Last action for screenshot tests did not finish in ' +
(lastActionTimeout / 1000 / 60) + ' minutes. Closing Firebase connection...');
return firebaseApp.delete().then(() => process.exit(1));
}
}, lastActionRefreshInterval);
console.log(` Starting screenshots task with results from e2e task...`);
return uploadTravisJobInfo(database, prNumber)
@@ -89,13 +73,11 @@ task('screenshots', () => {
.then(() => {
console.log(` Uploading results done (took ${Date.now() - lastActionTime}ms)`);
firebaseApp.delete();
clearTimeout(timeoutId);
})
.catch((err: any) => {
console.error(` Screenshot tests encountered an error!`);
console.error(err);
firebaseApp.delete();
clearTimeout(timeoutId);
});
}
});