Created
June 11, 2015 02:28
-
-
Save feiyuw/76faf6cfdf087a9a04a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # lib.py | |
| import signal | |
| from robot.running import EXECUTION_CONTEXTS | |
| from robot.running.keywords import Keyword | |
| import thread | |
| import os | |
| def do_error_log_monitoring(): | |
| def _stop_execution(signum, frame): | |
| Keyword('fatal error', ()).run(EXECUTION_CONTEXTS.current) | |
| def _monitor_log(): | |
| import time | |
| time.sleep(5) | |
| os.kill(os.getpid(), signal.SIGUSR1) | |
| signal.signal(signal.SIGUSR1, _stop_execution) | |
| thread.start_new_thread(_monitor_log, ()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment