Skip to content

chore: remove screenshot timeout check #7206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions tools/gulp/tasks/screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -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)
Expand Down Expand Up @@ -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);
});
}
});
Expand Down