simplemonitor
simplemonitor copied to clipboard
Add timeout option to tests
See #33. Add an option to make a test fail if it's taking too long.
Note self: https://pypi.python.org/pypi/subprocess32/
Thanks for your work on this James. Is this where I might want to manually adjust the timeout for now if I am currently only concerned with http?
https://github.com/jamesoff/simplemonitor/blob/master/Monitors/network.py
def run_test(self):
# store the current default timeout (since it's global)
original_timeout = socket.getdefaulttimeout()
socket.setdefaulttimeout(5)
Yup, that's the one.
#56 may be of use here as it looks like job execution can be given a timeout.
Should be able to handle this now that monitor evaluation is multithreaded, but I don't see a straightforward way to specify different timeouts for different monitors with it. Bumping for 1.12 while I think about it.