Skip to content

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

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions