Description of problem: The introduction of the condition [1] 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 [1] https://github.com/oVirt/pthreading/commit/490e837e0afed37823803d9e180a5d3eb17cb82c
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: 1 #!/usr/bin/python 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 6 7 if __name__ == '__main__': 8 sys.exit( 9 load_entry_point('nose==1.3.3', 'console_scripts', 'nosetests')() 10 )
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.