Skip to content

fix(sync): wait for initialize before leaving __enter__ - #3168

Open
Skn0tt wants to merge 3 commits into
microsoft:mainfrom
Skn0tt:skn0tt-fix-3165-sync-enter-init
Open

fix(sync): wait for initialize before leaving __enter__#3168
Skn0tt wants to merge 3 commits into
microsoft:mainfrom
Skn0tt:skn0tt-fix-3165-sync-enter-init

Conversation

@Skn0tt

@Skn0tt Skn0tt commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fixes half of #3165

sync_api/_context_manager.py blocked until the Playwright __create__, but
since #836 we really have to block until initialize finishes. Empty
with sync_playwright() was racing teardown against that still-in-flight RPC
and printing Future exception was never retrieved / Task was destroyed but it is pending on exit.

Migrating to wait on playwright_future (like async) also lets us drop the
now-unused call_on_object_with_known_name path.

Does not touch the separate JSON-serialization / register-after-send half.

Skn0tt and others added 2 commits August 4, 2026 17:09
Fixes: microsoft#3165

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16cb16dc-1986-42c7-90ce-9549b32cfccb
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16cb16dc-1986-42c7-90ce-9549b32cfccb
@Skn0tt
Skn0tt requested a review from dcrousso August 4, 2026 16:14
Comment thread playwright/_impl/_connection.py Outdated
Comment thread playwright/_impl/_connection.py Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16cb16dc-1986-42c7-90ce-9549b32cfccb
@Skn0tt
Skn0tt requested a review from dcrousso August 5, 2026 12:08
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