Skip to content

chore: do not abort operations upon dispatcher being disposed#40893

Merged
dgozman merged 4 commits into
microsoft:mainfrom
dgozman:chore-do-not-abort-operations
May 20, 2026
Merged

chore: do not abort operations upon dispatcher being disposed#40893
dgozman merged 4 commits into
microsoft:mainfrom
dgozman:chore-do-not-abort-operations

Conversation

@dgozman
Copy link
Copy Markdown
Collaborator

@dgozman dgozman commented May 18, 2026

The server-side library should correctly resolve/reject any calls instead.

The server-side library should correctly resolve/reject any calls instead.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The compilation cache fix and the server-side resolve/reject behavior
already handle resuming a paused debugger when the context closes, so
the explicit resume() call is unnecessary.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

These operations relied on dispatcher disposal aborting in-flight
progress. Make the server-side library terminate them itself:
- pickLocator races against page.openScope
- waitForTimeout races against page close / frame detach
- request context dispose rejects with a TargetClosedError
@github-actions
Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/annotate.spec.ts:173 › user-initiated annotate downloads zip with feedback.md @mcp-windows-latest-chrome

7115 passed, 1113 skipped


Merge workflow run.

@github-actions

This comment has been minimized.

The previous commit relied on dispatcher disposal aborting in-flight
progress to make late route.fetch() calls reject with TargetClosedError.
With that aborting removed, a request sent before _sendRequest attached
its Dispose listener could either complete successfully or hang.

Track _disposed on APIRequestContext and reject in _sendRequest right
after _updateRequestCookieHeader so that any request reaching the HTTP
layer after disposal fails with TargetClosedError.

Also make the playwright.fetch unrouteAll-hint test deterministic by
waiting for the page to actually close before invoking the late fetch.
@github-actions
Copy link
Copy Markdown
Contributor

Test results for "tests 1"

2 flaky ⚠️ [chromium-library] › library/popup.spec.ts:261 › should not throw when click closes popup `@ubuntu-22.04-chromium-tip-of-tree`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`

42031 passed, 850 skipped


Merge workflow run.

@dgozman dgozman merged commit e4d8313 into microsoft:main May 20, 2026
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants