commit e4772c103ec0e6517c8e427463fe9ce6a3576a26 Author: Kornel Benko <kor...@lyx.org> Date: Mon Aug 25 13:49:12 2014 +0200
keytests: add a timeout for LyX process to start If the LyX window does not appear after a certain (conservative) time, the keytest now fails. One reason that caused the LyX window to never show up was when DISPLAY was not set. This particular case has been fixed in <commit1hash>. This commit is meant for the more general scenario. (Collaboration with Scott Kostyshak) diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py index b2a89c2..cbfe2ff 100755 --- a/development/autotests/keytest.py +++ b/development/autotests/keytest.py @@ -342,7 +342,8 @@ while not failed: intr_system(lyx_exe + c[9:] + "&") else: intr_system(lyx_exe + " -userdir " + lyx_userdir + " " + c[9:] + "&") - while True: + count = 100 + while count > 0: lyx_pid=os.popen("pidof " + lyx).read().rstrip() if lyx_pid != "": lyx_window_name=os.popen("wmctrl -l -p | grep ' " + str(lyx_pid) + " ' | cut -d ' ' -f 1").read().rstrip() @@ -351,6 +352,11 @@ while not failed: print 'lyx_win: ' + lyx_window_name + '\n' print "Waiting for LyX to show up . . ." time.sleep(1) + count = count - 1 + if count <= 0: + print 'Timeout: could not start ' + lyx_exe, '\n' + sys.stdout.flush() + failed = True print 'lyx_pid: ' + lyx_pid + '\n' print 'lyx_win: ' + lyx_window_name + '\n' elif c[0:5] == 'Sleep':