[pypy-issue] Issue #3020: Error Code Handling in Multiprocessing Tests (pypy/pypy)

Andrew at bitbucket.org Andrew at bitbucket.org
Sun May 26 14:13:26 EDT 2019


New issue 3020: Error Code Handling in Multiprocessing Tests
https://bitbucket.org/pypy/pypy/issues/3020/error-code-handling-in-multiprocessing

Andrew Lawrence:

There is some behavior of error codes that I cannot explain in test\_multiprocessing\_spawn.py.

When running the tests lib-python\\3\\test\\test\_multiprocessing\_spawn.py WithManagerTestLock.test\_lock WithProcessesTestBarrier.test\_barrier on Windows the error code leaks from test\_lock into test\_barrier causing test\_barrier to fail.             

In CPython the error codes do not leak between the tests like this.

‌

I have also noticed that doing p \_winapi.GetLastError\(\) from pdb inside WithProcessesTestBarrier.test\_barrier in CPython produces the error code from the previous test but print\(\_winapi.GetLastError\(\)\) in the test itself does not result in the error.

Also inserting the following code into \_test\_multiprocessing.py results in different behaviour on both CPython and windows when running test\_multiprocessing\_spawn.py WithManagerTestLock.test\_lock 

```
class ManagerMixin(object):
  def tearDownClass(cls):
        import ctypes
        ctypes.windll.kernel32.SetLastError(996)
        print(_winapi.GetLastError())
        print(ctypes.windll.kernel32.GetLastError())
```

The final print statement produces 0 in CPython and 996 in PyPy




More information about the pypy-issue mailing list