From ea36d1a1174bcbd4516976e34adbd7015243dc9d Mon Sep 17 00:00:00 2001 From: Levi Pesin <35454228+LeviPesin@users.noreply.github.com> Date: Tue, 14 Feb 2023 19:35:26 +1030 Subject: [PATCH] Puppeteer E2E test: Fail if all Chromium snaphots are unaccessible (#25503) --- test/e2e/puppeteer.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/e2e/puppeteer.js b/test/e2e/puppeteer.js index 0e251fec7c5061..951022447bd167 100644 --- a/test/e2e/puppeteer.js +++ b/test/e2e/puppeteer.js @@ -275,13 +275,21 @@ async function downloadLatestChromium() { const revisions = await ( await fetch( OMAHA_PROXY ) ).json(); const omahaRevisionInfo = revisions.find( revs => revs.os === os ).versions.find( version => version.channel === chromiumChannel ); - let revision = omahaRevisionInfo.branch_base_position; - while ( ! ( await browserFetcher.canDownload( revision ) ) ) { + let revision = Number( omahaRevisionInfo.branch_base_position ); + while ( ! ( await browserFetcher.canDownload( String( revision ) ) ) && revision > 0 ) { - revision = String( revision - 1 ); + revision --; } + if ( revision === 0 ) { + + throw new Error( 'No Chromium snapshots available to download' ); + + } + + revision = String( revision ); + let revisionInfo = browserFetcher.revisionInfo( revision ); if ( revisionInfo.local === true ) {