Skip to content

fix: propagate dispatch error to current task #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 1, 2021
Merged

fix: propagate dispatch error to current task #917

merged 2 commits into from
Oct 1, 2021

Conversation

kumaraditya303
Copy link
Contributor

@kumaraditya303 kumaraditya303 commented Sep 24, 2021

Fixes #873

@mxschmitt
Copy link
Member

mxschmitt commented Sep 24, 2021

Can we have a test for it? The best would be for sync and async event emitters which fail without your change.

@kumaraditya303
Copy link
Contributor Author

Can we have a test for it? The best would be for sync and async event emitters which fail without your change.

@mxschmitt Added test

@mxschmitt
Copy link
Member

When executing the test on my environment it leads to the following:

(env) ➜  playwright-python git:(master) ✗ pytest --browser chromium tests/common/test_events.py             
Test session starts (platform: darwin, Python 3.9.7, pytest 6.2.4, pytest-sugar 0.9.4)
cachedir: .pytest_cache
rootdir: /Users/max/development/playwright-python, configfile: setup.cfg
plugins: cov-2.12.1, sugar-0.9.4, asyncio-0.15.1, flaky-3.7.0, xdist-2.3.0, repeat-0.9.1, timeout-1.4.2, forked-1.3.0
collecting ... 
 tests/common/test_events.py::test_events[chromium] ✓                                                                                                                                                100% ██████████

Results (3.15s):
       1 passed
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x1060550d0>
Traceback (most recent call last):
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_subprocess.py", line 126, in __del__
    self.close()
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_subprocess.py", line 104, in close
    proto.pipe.close()
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/unix_events.py", line 536, in close
    self._close(None)
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/unix_events.py", line 560, in _close
    self._loop.call_soon(self._call_connection_lost, exc)
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_events.py", line 746, in call_soon
    self._check_closed()
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

@kumaraditya303
Copy link
Contributor Author

When executing the test on my environment it leads to the following:

(env) ➜  playwright-python git:(master) ✗ pytest --browser chromium tests/common/test_events.py             
Test session starts (platform: darwin, Python 3.9.7, pytest 6.2.4, pytest-sugar 0.9.4)
cachedir: .pytest_cache
rootdir: /Users/max/development/playwright-python, configfile: setup.cfg
plugins: cov-2.12.1, sugar-0.9.4, asyncio-0.15.1, flaky-3.7.0, xdist-2.3.0, repeat-0.9.1, timeout-1.4.2, forked-1.3.0
collecting ... 
 tests/common/test_events.py::test_events[chromium] ✓                                                                                                                                                100% ██████████

Results (3.15s):
       1 passed
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x1060550d0>
Traceback (most recent call last):
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_subprocess.py", line 126, in __del__
    self.close()
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_subprocess.py", line 104, in close
    proto.pipe.close()
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/unix_events.py", line 536, in close
    self._close(None)
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/unix_events.py", line 560, in _close
    self._loop.call_soon(self._call_connection_lost, exc)
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_events.py", line 746, in call_soon
    self._check_closed()
  File "/Users/max/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

@mxschmitt Fixed in latest commit

@mxschmitt mxschmitt merged commit f6ef8a6 into microsoft:master Oct 1, 2021
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.

[Question]: how to fail test on any unsuccessful status?
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy