Browse Source

Puppeteer E2E test: Fail if all Chromium snaphots are unaccessible (#25503)

Levi Pesin 2 years ago
parent
commit
ea36d1a117
1 changed files with 11 additions and 3 deletions
  1. 11 3
      test/e2e/puppeteer.js

+ 11 - 3
test/e2e/puppeteer.js

@@ -275,13 +275,21 @@ async function downloadLatestChromium() {
 	const revisions = await ( await fetch( OMAHA_PROXY ) ).json();
 	const revisions = await ( await fetch( OMAHA_PROXY ) ).json();
 	const omahaRevisionInfo = revisions.find( revs => revs.os === os ).versions.find( version => version.channel === chromiumChannel );
 	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 );
 	let revisionInfo = browserFetcher.revisionInfo( revision );
 	if ( revisionInfo.local === true ) {
 	if ( revisionInfo.local === true ) {