From 34048953a17cdc415acd36b853513022b565346c Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 29 Oct 2024 14:14:25 -0300 Subject: [PATCH] [Tests][GUI][Added] Time-out of 10 seconds --- kibot/GUI/gui_inject.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kibot/GUI/gui_inject.py b/kibot/GUI/gui_inject.py index b0f8e225..b6e9ea01 100644 --- a/kibot/GUI/gui_inject.py +++ b/kibot/GUI/gui_inject.py @@ -7,11 +7,13 @@ # Code to do regression tests by injecting actions to the GUI code import csv +import signal import wx from ..gs import GS from .. import log logger = log.get_logger() +TIME_OUT = 10 IDLE_ID = wx.EVT_IDLE.typeId ids = {} # eventDict = {} @@ -131,9 +133,12 @@ def next_event_is_wait(self): return len(InjectDialog.events) and InjectDialog.events[0][1] == '_WaitDialog' def retire_event(self): + signal.alarm(0) if not InjectDialog.events: return False e = InjectDialog.events.pop(0) + # Create a time-out, in case the flow doesn't call us again + signal.alarm(TIME_OUT) id = e[0] command = e[1] data = e[2:]