Skip to content

[Bug]: RenderDocument introduces page.close() hang #42068

Closed as not planned
Closed as not planned

Description

@Skn0tt

Version

ToT

Steps to reproduce

test('should close page while reload is committing', async ({ context, browserName }) => {
  test.skip(browserName !== 'chromium');
  for (let i = 0; i < 20; i++) {
    const page = await context.newPage();
    await expect(page.evaluate(() => {
      location.reload();
      return new Promise(() => {});
    })).rejects.toThrow(/navigation/);
    await page.close(); // intermittently hangs
  }
});

Expected behavior

The test passes fine.

Actual behavior

page.close() hangs. To expose this behaviour, it's important to have the loop inside the test, running it without the loop but with --repeat-each doesn't expose it. I suppose it's linked to races within the context or something.

Additional context

This started at #41303.

Discovered through microsoft/playwright-python#3161.

Environment

Simon's Mac

Activity

  1. amanmaurya92 commented on Aug 4, 2026

    @amanmaurya92

    Dmitry Gozman (@dgozman) Simon Knott (@Skn0tt) can I have a stab at this? I would love to work on this.

  2. dgozman commented on Aug 14, 2026

    @dgozman
    Collaborator
  3. michkot commented on Aug 28, 2026

    @michkot

    Is there a consideration to revert #41303 before chromium bug fix lands in reasonable stable version, e.g. as in Mahnoor-Zaffar#1 ?

  4. michkot commented on Oct 8, 2026

    @michkot

    It seems that while chromium bug https://issues.chromium.org/u/1/issues/536385539 was in fixed state for a while, the implemented fix was reverted on Sept 22.

    FYI: for some reason this issue is greatly affecting our tests, so we eventually opted to reverse engineer chromium.launch, resulting in monkey patch through playwright.chromium._connection.toImpl of the server chromium object's _innerDefaultArgs -- its otherwise not possible to add more --disable-features. With that we unblocked ourselves on playwright 1.62+

  5. dgozman commented on Oct 22, 2026

    @dgozman
    Collaborator

    A new upstream fix was landed, hopefully getting into Chromium 158.

  6. pavelfeldman commented on Oct 31, 2026

    @pavelfeldman
    Member

    We're closing all P3-collecting-feedback issues and retiring the label. #43813 explains why. This doesn't mean the request is wrong. If it still matters to you, please open a new issue against the latest Playwright version with your concrete use case and link back here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions