Skip to content

fix(handlers): preserve non-control BaseException in listeners and callbacks - #3364

Closed
Alok Pandey (alok-108) wants to merge 1 commit into
microsoft:mainfrom
alok-108:fix-3360
Closed

Alok Pandey (alok-108) wants to merge 1 commit into
microsoft:mainfrom
alok-108:fix-3360

Conversation

@alok-108

Copy link
Copy Markdown
  • Catch non-control-flow BaseException subclasses (such as pytest.fail(), pytest.skip(), and pytest.xfail()) in EventEmitter, PlaywrightClient, remote transport dispatch, run_in_greenlet(), Waiter, RouteHandler, BindingCall, and Channel instead of only Exception, while re-raising KeyboardInterrupt, SystemExit, GeneratorExit, asyncio.CancelledError, and greenlet.GreenletExit.
  • Update rewrite_error_message() and ApiZone.error typing so non-Exception BaseException errors propagate unchanged without tearing down the transport or connection.
  • Add regression tests in tests/sync/python/test_sync.py and tests/async/python/test_listeners.py covering event listeners (with and without an error listener), route handlers, expect_console_message predicates, and exposed bindings.

Fixes #3360

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@dgozman

Copy link
Copy Markdown
Collaborator

The PR is too large for such an issue.

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.

[Regression]: pytest.fail() inside an event handler closes the connection

2 participants