sympy-bot-old icon indicating copy to clipboard operation
sympy-bot-old copied to clipboard

Some way for the bot to self-terminate instead of hang

Open asmeurer opened this issue 11 years ago • 3 comments

If the tests of a PR hang, then the bot will also hang, which isn't very good for headless machines. There should be some failsafe. An easy thing to do would be to add a timeout. The default could be something large (say 4 hours per interpreter), but it could be configured. This can be implemented using alarms from the signals module.

Another way would be to exit if no activity happens for some given amount of time. This is what Travis does. If no output is given in 10 minutes, it assumes the tests are hanging and gives up. I think to implement this, one just needs to reset the alarm every time something is written.

Regardless, we also have to make sure that the alarm is disabled at the end with a finally block so that it doesn't trigger after the tests are done.

asmeurer avatar Mar 17 '13 03:03 asmeurer

The last option is not as easy. I think one would need to hook sys.stdout with a custom function that resets the alarm, and you would need to be careful with subtleties like flushing and correctly reseting the alarm in finally.

asmeurer avatar Mar 17 '13 04:03 asmeurer

@asmeurer I experienced this issue when I was reviewing a PR the tests test_plot.py and test_plot_implicit.py took excessively long time and my system hanged. Did it hang any time for you?

vramana avatar Mar 17 '13 14:03 vramana

Yeah, sympy/sympy#1882.

asmeurer avatar Mar 17 '13 19:03 asmeurer