Skip to content

Commit

Permalink
[Tests][GUI][Added] Time-out of 10 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Oct 29, 2024
1 parent 6ac412b commit 3404895
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kibot/GUI/gui_inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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:]
Expand Down

0 comments on commit 3404895

Please sign in to comment.