mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Jeremy Elbourn
parent
3982cc8b60
commit
1ac3fd25c9
@@ -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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user