Skip to content
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

Bugfix/pyodide handle playwright loop #149

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tomjakubowski
Copy link

WIP, will clean up and remove tomtests directory

closes #148

tomjakubowski and others added 5 commits February 20, 2025 19:57
Run this:

```
uv sync --all-extras
uv run pytest --runner playwright --rt chrome tomtests/
```

And see this:

```
Exception ignored in: <function PyodideHandle.__del__ at 0x100f6e8e0>
Traceback (most recent call last):
  File "/Users/tom/github.com/pyodide/pytest-pyodide/pytest_pyodide/decorator.py", line 88, in __del__
    self.selenium.run_js(
  File "/Users/tom/github.com/pyodide/pytest-pyodide/pytest_pyodide/runner.py", line 262, in run_js
    return self.run_js_inner(code, check_code)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tom/github.com/pyodide/pytest-pyodide/pytest_pyodide/runner.py", line 415, in run_js_inner
    retval = self.driver.evaluate(wrapper % (code, check_code))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tom/github.com/pyodide/pytest-pyodide/.venv/lib/python3.12/site-packages/playwright/sync_api/_generated.py", line 8530, in evaluate
    self._sync(
  File "/Users/tom/github.com/pyodide/pytest-pyodide/.venv/lib/python3.12/site-packages/playwright/_impl/_sync_base.py", line 104, in _sync
    raise Error("Event loop is closed! Is Playwright already stopped?")
playwright._impl._errors.Error: Event loop is closed! Is Playwright already stopped?
```
@hoodmane
Copy link
Member

Thanks for working on this @tomjakubowski !

@ryanking13
Copy link
Member

We've currently disabled the playwright tests in our CI, as it was too flaky and slow. I guess I can test it manually and merge, but I didn't have time to take a look at playwright issues.

@agriyakhetarpal
Copy link
Member

agriyakhetarpal commented Feb 22, 2025

@tomjakubowski, could you please sync your branch with main? For some reason, I'm unable to do it.

Edit: never mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants