Skip to content

Tests sometimes fail with PyPy3 #140

Open
@sbraz

Description

@sbraz

Hi,
It looks like tests sometimes fail when running PyPy3 (pypy-7.3.7-final):

test/test_plyvel.py::test_threading PASSEDpypy3: /build/leveldb-yUlUFD/leveldb-1.22/db/version_set.cc:779: leveldb::VersionSet::~VersionSet(): Assertion `dummy_versions_.next_ == &dummy_versions_' failed.
Fatal Python error: Aborted

Stack (most recent call first, approximate line numbers):
  File "/plyvel/test/test_plyvel.py", line 40 in finalize
  File "/opt/pypy/site-packages/_pytest/fixtures.py", line 1021 in finish
  File "/opt/pypy/lib_pypy/_functools.py", line 77 in __call__
  File "/opt/pypy/site-packages/_pytest/runner.py", line 389 in _callfinalizers
  File "/opt/pypy/site-packages/_pytest/runner.py", line 404 in _teardown_with_finalization
  File "/opt/pypy/site-packages/_pytest/runner.py", line 385 in _pop_and_teardown
  File "/opt/pypy/site-packages/_pytest/runner.py", line 421 in _teardown_towards
  File "/opt/pypy/site-packages/_pytest/runner.py", line 417 in teardown_exact
  File "/opt/pypy/site-packages/_pytest/runner.py", line 173 in pytest_runtest_teardown
  File "/opt/pypy/site-packages/pluggy/_callers.py", line 9 in _multicall
  File "/opt/pypy/site-packages/pluggy/_manager.py", line 77 in _hookexec
  File "/opt/pypy/site-packages/pluggy/_hooks.py", line 244 in __call__
  File "/opt/pypy/site-packages/_pytest/runner.py", line 255 in <lambda>
  File "/opt/pypy/site-packages/_pytest/runner.py", line 298 in from_call
  File "/opt/pypy/site-packages/_pytest/runner.py", line 240 in call_runtest_hook
  File "/opt/pypy/site-packages/_pytest/runner.py", line 212 in call_and_report
  File "/opt/pypy/site-packages/_pytest/runner.py", line 114 in runtestprotocol
  File "/opt/pypy/site-packages/_pytest/runner.py", line 106 in pytest_runtest_protocol
  File "/opt/pypy/site-packages/pluggy/_callers.py", line 9 in _multicall
  File "/opt/pypy/site-packages/pluggy/_manager.py", line 77 in _hookexec
  File "/opt/pypy/site-packages/pluggy/_hooks.py", line 244 in __call__
  File "/opt/pypy/site-packages/_pytest/main.py", line 336 in pytest_runtestloop
  File "/opt/pypy/site-packages/pluggy/_callers.py", line 9 in _multicall
  File "/opt/pypy/site-packages/pluggy/_manager.py", line 77 in _hookexec
  File "/opt/pypy/site-packages/pluggy/_hooks.py", line 244 in __call__
  File "/opt/pypy/site-packages/_pytest/main.py", line 319 in _main
  File "/opt/pypy/site-packages/_pytest/main.py", line 256 in wrap_session
  File "/opt/pypy/site-packages/_pytest/main.py", line 315 in pytest_cmdline_main
  File "/opt/pypy/site-packages/pluggy/_callers.py", line 9 in _multicall
  File "/opt/pypy/site-packages/pluggy/_manager.py", line 77 in _hookexec
  File "/opt/pypy/site-packages/pluggy/_hooks.py", line 244 in __call__
  File "/opt/pypy/site-packages/_pytest/config/__init__.py", line 130 in main
  File "/opt/pypy/site-packages/_pytest/config/__init__.py", line 178 in console_main
  File "/opt/pypy/bin/pytest", line 3 in <module>
  File "<builtin>/app_main.py", line 867 in execfile
  File "<builtin>/app_main.py", line 109 in run_toplevel
  File "<builtin>/app_main.py", line 607 in run_command_line
  File "<builtin>/app_main.py", line 944 in entry_point
Aborted (core dumped)

Other times, I get this non-fatal error:

======================= 52 passed, 1 deselected in 4.76s =======================
Exception ignored in: weakref callback <cyfunction __init__.<locals>.<lambda> at 0x7f1234686bd0>
Traceback (most recent call last):  
  File "plyvel/_plyvel.pyx", line 695, in plyvel._plyvel.BaseIterator.__init__.lambda
    lambda wr: ref_dict.pop(iterator_id))
KeyError: 139716944199424                  

Reproducer Dockerfile:

FROM pypy:3
RUN git clone --depth 1 https://github.com/wbolster/plyvel/
WORKDIR plyvel
RUN apt update
RUN apt install -y libleveldb-dev
RUN pip install cython pytest
RUN cython --cplus --fast-fail --annotate plyvel/_plyvel.pyx
RUN pypy3 setup.py install
RUN pytest --import-mode=append -vv --deselect test/test_plyvel.py::test_open_read_only_dir

Please note that this does not always fail, sometimes all tests pass. I believe the first error message has to do with threading since it happens immediately afterwards.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions