-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: interception id not found error in route.continue (#29180)
We stopped catching all exceptions in #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 #29123
- Loading branch information
Showing
2 changed files
with
37 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters