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
Version
ToT
Steps to reproduce
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-eachdoesn'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