From 20c90836aa10045db330699439416197df9fc761 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Sat, 22 Jun 2019 16:37:42 +0100 Subject: Speed up robot tests with polling --- robot/robot.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'robot/robot.sh') diff --git a/robot/robot.sh b/robot/robot.sh index 8b7e9a3..c5cc33d 100644 --- a/robot/robot.sh +++ b/robot/robot.sh @@ -69,10 +69,16 @@ function wait_emacs { } function find_bot { - window_id=`xdotool search --name "emacs-bot"` - if [ -z "$window_id" ] - then - echo "Could not find window ID for Emacs-bot" - exit 1 - fi + for i in `seq 1 20`; + do + window_id=`xdotool search --name "emacs-bot"` + if [ -z "$window_id" ] + then + sleep 0.1 + else + return + fi + done + echo "Could not find window ID for Emacs-bot" + exit 1 } -- cgit v1.2.3