Description of problem:
The introduction of the condition  that fail with exception while module thread is being imported before monkey patch it, raised that exception while noisetests starts up. One of nose imports import thread before we manage to call the monkey patch function in python-pthreading
Monkey patching in the testrunner is too late - we need to monkey patch using something like site.py or other means that perform the monkeypatch first thing before importing anything else.
One option is to have our own nosetest executable:
2 # EASY-INSTALL-ENTRY-SCRIPT: 'nose==1.3.3','console_scripts','nosetests'
3 __requires__ = 'nose==1.3.3'
4 import sys
Here we can import pthreading and monkey patch.
5 from pkg_resources import load_entry_point
7 if __name__ == '__main__':
9 load_entry_point('nose==1.3.3', 'console_scripts', 'nosetests')()
Turns out that the issue was importing and running pthreading.monkey_patch twice in the tests, because we used testrunner both as script and library. The attached patch fixes this issue.
CodeChange only or is it easy for a verification? If the latter please provide steps for verification. Thx.
this is not really testable by QA, it is code change in devel nose tests.