Comment 6 for bug 1302670

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Sure, no problem. So the only thing you need is to let a thread context switch happen while this test is being run. The way I ran into this is that I updated common DB code from oslo-incubator which replaced all eventlet.greenthread.sleep() calls with time.sleep() calls (i.e. within cinder/openstack/common/db/ dir). So you could do that. Or you could disable monkey patching of sleep entirely here: https://github.com/openstack/cinder/blob/master/cinder/tests/test_storwize_svc.py#L1506

Just FYI, monkey patching both greenthread.sleep() and time.sleep() calls would work, but I'm not sure this the way we should solve this problem. IMO, this monkey patching was added only to make the test pass, while the real issue is in the code, which doesn't really cope well with context switches (and there will be context switches when this code is run in production).

So if you're familiar with this code/test, I'd recommend to dig a bit deeper, spend some time and eventually find out what is wrong with the code and why it fails on context switches.