Skip to content

[Bug]: recordHar: context.close() hangs when a response's raw headers never arrive #42448

Description

Version

1.59.1; 9642f57

Steps to reproduce

  1. Clone https://github.com/jackdlb-uipath/playwright-har-flush-hang-repro.git
npm install
npx playwright install chromium
node repro.js

Expected behavior

context.close() completes, and the HAR entry keeps the provisional headers that HarTracer._onResponse already recorded for exactly this case.

Actual behavior

context.close() never resolves.

Tearing down "context" exceeded the test timeout of 100000ms.

Additional context

https://github.com/jackdlb-uipath/playwright-har-flush-hang-repro/blob/main/README.md

reproduces when running in mcr.microsoft.com/playwright:v1.59.1-noble docker image

NOT a duplicate of #42231 as far as I can tell, but actually a different issue

Environment

System:
  OS: Linux 6.10 Ubuntu 24.04.4 LTS 24.04.4 LTS (Noble Numbat)
  CPU: (10) x64 VirtualApple @ 2.50GHz
  Memory: 24.27 GB / 25.40 GB
  Container: Yes
Binaries:
  Node: 24.14.1 - /usr/bin/node
  Yarn: 1.22.22 - /usr/bin/yarn
  npm: 11.11.0 - /usr/bin/npm
Languages:
  Bash: 5.2.21 - /usr/bin/bash
npmPackages:
  playwright: ^1.59.1 => 1.59.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions