Skip to content

Instantly share code, notes, and snippets.

@feiyuw
Created June 11, 2015 02:28
Show Gist options
  • Save feiyuw/76faf6cfdf087a9a04a2 to your computer and use it in GitHub Desktop.
Save feiyuw/76faf6cfdf087a9a04a2 to your computer and use it in GitHub Desktop.
# 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