fix tests sometimes timing out in ci

develop
Myk Taylor 2023-08-21 01:48:42 -07:00
parent 2d71a6b009
commit a7a5742710
No known key found for this signature in database
1 changed files with 7 additions and 4 deletions

@ -162,16 +162,19 @@ end
local function ensure_title_screen() local function ensure_title_screen()
for i = 1, 100 do for i = 1, 100 do
local scr = dfhack.gui.getCurViewscreen() local scr = dfhack.gui.getCurViewscreen()
if is_title_screen(scr) then if df.viewscreen_initial_prepst:is_instance(scr) then
delay(10000)
elseif is_title_screen(scr) then
print('Found title screen') print('Found title screen')
return return
end else
scr:feed_key(df.interface_key.LEAVESCREEN) scr:feed_key(df.interface_key.LEAVESCREEN)
delay(10) delay(10)
end
if i % 10 == 0 then print('Looking for title screen...') end if i % 10 == 0 then print('Looking for title screen...') end
end end
qerror(string.format('Could not find title screen (timed out at %s)', qerror(string.format('Could not find title screen (timed out at %s)',
dfhack.gui.getCurFocus(true))) dfhack.gui.getCurFocus(true)[1]))
end end
local function is_fortress(focus_string) local function is_fortress(focus_string)