You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
$ py.test tests/ -s -k test_singleton_contextmanager_method_with_rlocks_bad_order
========================================== test session starts ===========================================
platform linux -- Python 3.6.2, pytest-3.0.6, py-1.4.32, pluggy-0.4.0
rootdir: /files/code/easypy, inifile: pytest.ini
collected 118 items
tests/test_decorations.py Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/files/code/easypy/tests/test_decorations.py", line 87, in lock_and_wait
event.wait()
File "/usr/lib/python3.6/contextlib.py", line 88, in __exit__
next(self.gen)
File "/files/code/easypy/easypy/decorations.py", line 114, in inner
yield val
File "/files/code/easypy/easypy/decorations.py", line 90, in __exit__
self.ctm.__exit__(*sys.exc_info())
File "/usr/lib/python3.6/contextlib.py", line 88, in __exit__
next(self.gen)
File "/files/code/easypy/tests/test_decorations.py", line 79, in cm
yield
RuntimeError: cannot release un-acquired lock
.
========================================== 117 tests deselected ==========================================
================================ 1 passed, 117 deselected in 1.31 seconds ================================
(the test still passes, but there is an exception in a thread)
The problem here is that we lock in thread1 - the first thread to enter the singleton contextmanager - and release in thread2 - the last thread to exit the singleton contextmanager.
I'm... not really sure if we can fix this...
The text was updated successfully, but these errors were encountered:
Running this test prints:
(the test still passes, but there is an exception in a thread)
The problem here is that we lock in
thread1
- the first thread to enter the singleton contextmanager - and release inthread2
- the last thread to exit the singleton contextmanager.I'm... not really sure if we can fix this...
The text was updated successfully, but these errors were encountered: