playwright icon indicating copy to clipboard operation
playwright copied to clipboard

Chromium install bar breaking in CI

Open CKReiff opened this issue 3 years ago • 2 comments
trafficstars

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

It breaks on this line when deploying in CI. With this error msg: Downloading Chromium 105.0.5195.19 (playwright build v1019)... /node_modules/playwright-core/lib/server/registry/download.js:165 console.log(|${'■'.**repeat**(row * stepWidth)}${' '.repeat((totalRows - row) * stepWidth)}| ${percentageString}% of ${toMegabytes(totalBytes)}); RangeError: Invalid count value ERROR: Something went wrong in run-commands - Command failed: npx playwright install chromium

Here is the diff that solved my problem:

diff --git a/node_modules/playwright-core/lib/server/registry/download.js b/node_modules/playwright-core/lib/server/registry/download.js
index 78d5c53..a10aa32 100644
--- a/node_modules/playwright-core/lib/server/registry/download.js
+++ b/node_modules/playwright-core/lib/server/registry/download.js
@@ -162,7 +162,7 @@ function _getBasicDownloadProgress(progressBarName) {
       lastRow = row;
       const percentageString = String(percentage * 100 | 0).padStart(3); // eslint-disable-next-line no-console
 
-      console.log(`|${'■'.repeat(row * stepWidth)}${' '.repeat((totalRows - row) * stepWidth)}| ${percentageString}% of ${toMegabytes(totalBytes)}`);
+      // console.log(`|${'■'.repeat(row * stepWidth)}${' '.repeat((totalRows - row) * stepWidth)}| ${percentageString}% of ${toMegabytes(totalBytes)}`);
     }
   };
 }

This issue body was partially generated by patch-package.

CKReiff avatar Sep 13 '22 12:09 CKReiff

Is this reproducible all the time for you? We have this download progress bar since year and you are the first one who run into this bug. Would appreciate if you could debug that further and log maybe the value of row, downloadedBytes, and totalBytes since we'd like to understand what happens.

So somehow the value which gets passed into repeat is negative.

mxschmitt avatar Sep 13 '22 14:09 mxschmitt

Unfortunately it's really flaky and hard to reproduce. It seems to happen only when CI is a bit loaded. Might be some kind of race condition. I tried reproducing it 10 times today without any luck.

CKReiff avatar Sep 14 '22 11:09 CKReiff

Why was this issue closed?

Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.

Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.

pavelfeldman avatar Jun 30 '23 19:06 pavelfeldman