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

TST: can't pickle pyodide.InternalError #82

Open
rth opened this issue Apr 4, 2023 · 4 comments
Open

TST: can't pickle pyodide.InternalError #82

rth opened this issue Apr 4, 2023 · 4 comments

Comments

@rth
Copy link
Member

rth commented Apr 4, 2023

Now in #80 (that just updates linting) we start to see the issue about picklability of InternalError. I think this is likely related to changes in pyodide 0.23.0

@hoodmane for JsException that got subclassed into a Python Exception I guess we don't support for them to be picklable, while this tries to do it when passing errors between the runner and the host?

___________________________ test_hypothesis[firefox] ___________________________
pytest_pyodide/decorator.py:194: in test_hypothesis
    ???
pytest_pyodide/runner.py:212: in run_async
    return self.run_js(
pytest_pyodide/runner.py:249: in run_js
    return self.run_js_inner(code, check_code)
pytest_pyodide/runner.py:354: in run_js_inner
    raise JavascriptException(retval[1], retval[2])
E   pytest_pyodide.runner.JavascriptException: PythonError: Traceback (most recent call last):
E     File "<string>", line 104, in run_in_pyodide_main
E     File "/home/runner/work/pytest-pyodide/pytest-pyodide/tests/test_decorator.py", line 225, in test_hypothesis
E   pyodide.InternalError: Internal error occurred in compute_typeflags
E   
E   During handling of the above exception, another exception occurred:
E   
E   Traceback (most recent call last):
E     File "/lib/python3.10/asyncio/futures.py", line 201, in result
E       raise self._exception
E     File "/lib/python3.10/asyncio/tasks.py", line 232, in __step
E       result = coro.send(None)
E     File "<string>", line 116, in run_in_pyodide_main
E     File "<string>", line 75, in encode
E   _pickle.PicklingError: Can't pickle <class 'pyodide.InternalError'>: attribute lookup InternalError on pyodide failed
@rth rth changed the title CI: can't pickle pyodide.InternalError TST: can't pickle pyodide.InternalError Apr 4, 2023
@ryanking13
Copy link
Member

The CI succeed in the main branch after merging #80, and we don't run CI against 0.23.0, so I guess it is flaky becuase of some randomness in hypothesis? I don't understand what the error means though...

@hoodmane
Copy link
Member

hoodmane commented Apr 4, 2023

Well the pickle problem is that we should export internal error to pyodide.ffi.InternalError. Can't pickle things you don't export.

@hoodmane
Copy link
Member

hoodmane commented Apr 5, 2023

I am pretty sure InternalError was never picklable, we just hadn't noticed since they are quite rare.

@hoodmane
Copy link
Member

hoodmane commented Apr 5, 2023

I guess we should copy that test into Pyodide test_typeconversions. Hypothesis is a beast!

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

No branches or pull requests

3 participants