mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-11 12:33:45 +03:00
82981a8091
We stopped catching all exceptions in https://github.com/microsoft/playwright/pull/28539 in hope that we'll get loadingFailed even before Fetch.continue/fulfill command's error. Turns out this is racy and may fail if the test cancels the request while we are continuing it. The following test could in theory reproduce it if stars align and the timing is good: ```js it('page.continue on canceled request', async ({ page }) => { let resolveRoute; const routePromise = new Promise<Route>(f => resolveRoute = f); await page.route('http://test.com/x', resolveRoute); const evalPromise = page.evaluate(async () => { const abortController = new AbortController(); (window as any).abortController = abortController; return fetch('http://test.com/x', { signal: abortController.signal }).catch(e => 'cancelled'); }); const route = await routePromise; void page.evaluate(() => (window as any).abortController.abort()); await new Promise(f => setTimeout(f, 10)); await route.continue(); const req = await evalPromise; expect(req).toBe('cancelled'); }); ``` Fixes https://github.com/microsoft/playwright/issues/29123 |
||
---|---|---|
.. | ||
html-reporter | ||
playwright | ||
playwright-browser-chromium | ||
playwright-browser-firefox | ||
playwright-browser-webkit | ||
playwright-chromium | ||
playwright-core | ||
playwright-ct-core | ||
playwright-ct-react | ||
playwright-ct-react17 | ||
playwright-ct-solid | ||
playwright-ct-svelte | ||
playwright-ct-vue | ||
playwright-ct-vue2 | ||
playwright-firefox | ||
playwright-test | ||
playwright-webkit | ||
protocol/src | ||
recorder | ||
trace/src | ||
trace-viewer | ||
web | ||
.eslintrc-with-ts-config.js | ||
.eslintrc.js |