diff --git a/test/test.py b/test/test.py index 2b0c89f..bd343a2 100644 --- a/test/test.py +++ b/test/test.py @@ -1,6 +1,7 @@ import subprocess import sys import signal +from time import sleep from caproto_wrapper import CaprotoWrapper @@ -8,9 +9,15 @@ def is_ioc_running(): return "" != CaprotoWrapper.raw_read("ePowerSwitch_set_outlet_1") def start_iocshell(): + attempt = 0; res = subprocess.Popen(["./startioc.sh"]) - while not is_ioc_running(): + while not is_ioc_running() and attempt < 10: + sleep(1) + attempt += 1 pass + if attempt == 10: + print("IOCSHELL didn't start on time"); + sys.exit(-1) return res def start_sim():