testing/cffi0/test_vgen2.py::test_errno_working_even_with_pypys_jit FAILED
Created originally on Bitbucket by mno-hime (Michal Nowak)
When running CFFI 1.12.2 test suite with Python 2.7.16 and 3.4.9 in 32-bit and 64-bit mode and Python 3.5.6 in 64-bit mode on OpenIndiana 2018.10 (illumos distribution) I get following failure:
testing/cffi0/test_vgen2.py::test_errno_working_even_with_pypys_jit <- testing/cffi0/test_verify.py FAILED
32-bit
test_errno_working_even_with_pypys_jit
def test_errno_working_even_with_pypys_jit():
ffi = FFI()
ffi.cdef("int f(int);")
lib = ffi.verify("""
#include <errno.h>
int f(int x) { return (errno = errno + x); }
""")
> @_run_in_multiple_threads
def test1():
testing/cffi0/test_verify.py:2111:
test1 = <function test1 at 0xfcc2b614>
def _run_in_multiple_threads(test1):
test1()
import sys
try:
import thread
except ImportError:
import _thread as thread
errors = []
def wrapper(lock):
try:
test1()
except:
errors.append(sys.exc_info())
lock.release()
locks = []
for i in range(10):
_lock = thread.allocate_lock()
_lock.acquire()
thread.start_new_thread(wrapper, (_lock,))
locks.append(_lock)
for _lock in locks:
_lock.acquire()
if errors:
> raise errors[0][1]
E assert 10042 == (0 + 1)
testing/cffi0/test_verify.py:2102: AssertionError
64-bit
test_errno_working_even_with_pypys_jit
def test_errno_working_even_with_pypys_jit():
ffi = FFI()
ffi.cdef("int f(int);")
lib = ffi.verify("""
#include <errno.h>
int f(int x) { return (errno = errno + x); }
""")
> @_run_in_multiple_threads
def test1():
testing/cffi0/test_verify.py:2111:
testing/cffi0/test_verify.py:2102: in _run_in_multiple_threads
raise errors[0][1]
testing/cffi0/test_verify.py:2089: in wrapper
test1()
@_run_in_multiple_threads
def test1():
ffi.errno = 0
for i in range(10000):
e = lib.f(1)
> assert e == i + 1
E assert 12 == (0 + 1)
testing/cffi0/test_verify.py:2116: AssertionError