Repository navigation
fix(sync): deactivate resume callbacks when waits end - #3311
microsoft-playwright-automation[bot] wants to merge 1 commit into
Conversation
Pavel Feldman (pavelfeldman)
left a comment
There was a problem hiding this comment.
The fix in _greenlets.py is right. Two changes:
- The test fails on the stable channels, see the inline comment: use a predicate.
- In the
exceptbranch ofwait_for_future, remove the callback beforefuture.cancel(), as before. A cancelled plain future otherwise queues an inert callback.
Ignore the macOS WebGL and the Windows WebKit screencast failures; they are not from this change.
| context = browser.new_context() | ||
| page = context.new_page() | ||
| page.goto(empty_page) | ||
| with page.expect_console_message() as console_info: |
There was a problem hiding this comment.
This fails on the Linux chrome, Windows chrome and Windows msedge jobs: the child asserts at console_info.value.text == "hello" on every attempt. Branded Chrome and Edge emit another console message first, and without a predicate the block takes the first message. Match the message:
| with page.expect_console_message() as console_info: | |
| with page.expect_console_message(lambda m: m.text == "hello") as console_info: |
The predicate runs inside the event dispatch, so the future is still done before __exit__ waits on it, and the test still covers the bug.
There was a problem hiding this comment.
Added the predicate so the wait matches only hello. The regression still fails without the fix on Chromium, Firefox and WebKit, and passes with it on all three, plus stable Chrome and Edge on Linux.
Revised on Linux by the Playwright bot - agent run
|
Hi, I'm the Playwright bot. I addressed both review requests. The shutdown test now matches the On Linux with Python 3.12.15, the updated regression fails without the fix on Chromium, Firefox and WebKit, and passes with it on all three, plus stable Chrome and Edge. The neighbouring sync checks pass (125 passed, 1 upstream skip); the async checks pass (65 passed, 4 expected skips). Revised on Linux by the Playwright bot - agent run |
a5140e5 to
79849c7
Compare
remove_done_callback()cannot remove.Verified on Linux with Python 3.12.15: sync shutdown and console checks under xdist (125 passed, one existing upstream skip); async context-manager and console checks (62 passed, the same skip).
mypy playwrightand./scripts/lint.shpass.Fixes #3307
Triaged on Linux by the Playwright bot - agent run