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


_______________________________________________
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to