Playwright/Chromium: Request stuck pending for localhost:8082

Viewed 55

I just installed Playwright to create some automated tests for my web-app.

I got my test running fine on the staging version of my site just fine, but one of my requests is hanging when I try running it against localhost:

enter image description here

I have Nginx running on :8080 and webpack running on :8082 to serve my JS. As you can see, the document ("create") is served from :8080 no problem, but all.js which is http://localhost:8082/assets/all.js never finishes.

What's really confusing me though is that I can load that URL in a new tab in Chrome just fine, I can wget under WSL, and I can curl it under cmd.exe. So there's something funky going on with the networking when the browser instance is created by Playwright, but I don't know how to debug further. The same thing happens if I set defaultBrowserType: 'firefox'.

enter image description here

What else can I try?


I just found chrome://net-export/ and enabled it during the request. I've got all the CLI flags now:

    "clientInfo": {
      "cl": "b9c217c128c16f53d12f9a02933fcfdec1bf49af-refs/branch-heads/5195@{#176}",
      "command_line": "\"C:\\Users\\Mark\\AppData\\Local\\ms-playwright\\chromium-1019\\chrome-win\\chrome.exe\" --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --auto-open-devtools-for-tabs --deny-permission-prompts --allow-loopback-in-peer-connection --user-data-dir=\"C:\\Users\\Mark\\AppData\\Local\\Temp\\playwright_chromiumdev_profile-5Cth57\" --remote-debugging-pipe --no-startup-window --flag-switches-begin --flag-switches-end --file-url-path-alias=\"/gen=C:\\Users\\Mark\\AppData\\Local\\ms-playwright\\chromium-1019\\chrome-win\\gen\"",
      "name": "Chromium",
      "official": "unofficial",
      "os_type": "Windows NT: 10.0.19044 (x86_64)",
      "version": "105.0.5195.19",
      "version_mod": ""
    },

And a few request details:

    {
      "params": {
        "headers": [
          "Host: localhost:8082",
          "Connection: keep-alive",
          "sec-ch-ua: \"Chromium\";v=\"105\", \"Not)A;Brand\";v=\"8\"",
          "Origin: http://localhost:8080",
          "Accept-Language: en-CA",
          "sec-ch-ua-mobile: ?0",
          "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
          "sec-ch-ua-platform: \"Windows\"",
          "Accept: */*",
          "Sec-Fetch-Site: same-site",
          "Sec-Fetch-Mode: cors",
          "Sec-Fetch-Dest: script",
          "Referer: http://localhost:8080/",
          "Accept-Encoding: gzip, deflate, br"
        ],
        "line": "GET /assets/all.js HTTP/1.1\r\n"
      },
      "phase": 0,
      "source": {
        "id": 170,
        "start_time": "131696227",
        "type": 1
      },
      "time": "131696228",
      "type": 169
    },

Nothing really jumps out at me as suspicious though.

0 Answers
Related