Open pbrady opened 10 years ago
Interesting. How can they get lost?
No Idea. http://stackoverflow.com/questions/25874823/pyerr-checksignals-not-picking-up-signal.
Hopefully someone knows. The alternative will be to increase the splits and not use fastcache for the slow tests.
Signals mess with C library functions. See for instance https://github.com/joerick/pyinstrument/issues/16#issuecomment-47174190 (I don't know of a better resource for this now).
@certik and I talked it through and I think the problem was that I wasn't checking the return value for every call into the Python-C-API (i.e. I knew my argument was hashable so I didn't check the return value of PyDict_SetItem). However, these calls passed control back to the interpreter which would have caught the signal and turned it into an exception via the callback. Thus no call into the Python-C-api is safe! Tricky. I'm testing out patches at the moment.
Looks like there are still timeout errors even without fastcache https://travis-ci.org/sympy/sympy/jobs/36210280. Maybe this is actually fixed and travis doesn't do timeouts well
Exactly I think that the gmpy
module might be swallowing signals just like yours did.
Actually, that particular failure doesn't use gmpy. Hm.
I'm tempted to just blame travis. I wonder if others have this issue with signals and travis?
I don't know about signals, but Travis does seem to have issues with timeouts sometimes, because the virtual machines can be slow.
But this particular timeout is the No output for 10 minutes
kind when the slow tests have a default timeout of 180s. It could just be a fluke but it's something to watch. It looks like one can avoid using signals but it's tricky to get right http://eli.thegreenplace.net/2011/08/22/how-not-to-set-a-timeout-on-a-computation-in-python
Oh that has definitely been happening long before we used fastcache. I at some point disabled the slow tests because of it.
Ah. I'll probably try to do some more involve testing on my local machine then and just ignore whatever happens on travis.
The
timeout
signal raised during the long running test_wester tests in sympy seem to get lost.timeout=180
timeout = 30