microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.85k stars 3.66k forks source link

[Bug]: Download from azureedge incredibly slow #32438

Open la-magra opened 2 months ago

la-magra commented 2 months ago

Version

1.46.1

Steps to reproduce

$ yarn playwright install
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ubuntu20.04-x64.
Downloading Chromium 128.0.6613.18 (playwright build v1129) from https://playwright.azureedge.net/builds/chromium/1129/chromium-linux.zip
162.8 MiB [===                 ] 12% 5743.0s

# or

$ curl -O https://playwright.azureedge.net/builds/chromium/1129/chromium-linux.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  6  162M    6 9999k    0     0  27222      0  1:44:29  0:06:16  1:38:13 22534

Expected behavior

A download that does not take two hours.

Actual behavior

Wow, much speed, I guess I'll wait two hours for CI to complete.

Additional context

Reproducible from multiple remote machines from Mexico and Colombia, at least one University impacted.

Environment

System:
    OS: Linux 6.6 Arch Linux
    Memory: 5.29 GB / 15.55 GB
    Container: Yes
  Binaries:
    Node: 20.17.0 - ~/.node/bin/node
    Yarn: 4.4.1 - ~/.node/bin/yarn
    npm: 10.8.2 - ~/.node/bin/npm
  Languages:
    Bash: 5.2.32 - /usr/bin/bash
  npmPackages:
    playwright: 1.46.1 => 1.46.1
pavelfeldman commented 2 months ago

where are you located and how ling does it typically take you to download a regular browser?

la-magra commented 2 months ago

This is contract work.

playwright install is being run from a development machine VM I connect to remotely, that is located in some site of a Mexican university (never even asked for a location).

A normal download speed for a browser (63MB) in that machine is 13s :

$ curl -Ol 'https://download-installer.cdn.mozilla.net/pub/firefox/releases/130.0/win64/en-US/Firefox%20Setup%20130.0.exe'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 63.4M  100 63.4M    0     0  4972k      0  0:00:13  0:00:13 --:--:-- 12.4M

compared to :

Downloading Firefox 128.0 (playwright build v1458) from https://playwright.azureedge.net/builds/firefox/1458/firefox-ubuntu-20.04.zip
85.6 MiB [================    ] 80% 918.0s
pavelfeldman commented 2 months ago

Sounds like they are deliberately throttling the Azure CDNs, not much we can do about it.

la-magra commented 2 months ago

I'll contact their network guys in once it's morning in that hemisphere. But it's strange, I've already replicated the download throttling in 4 different networks, in two different countries.

Perhaps same firewall appliance or security lists?

mxschmitt commented 2 months ago

We are in the process of migrating to a different CDN infrastructure, could you try the following?

PLAYWRIGHT_DOWNLOAD_HOST=https://playwright.azureedge.net/download/playwright npx playwright install

(even tho it still looks like azureedge, it redirects to something else)

la-magra commented 2 months ago

That seems to work.