From b044ce4cc806ddb01a86fb19b395475c8a01cc43 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Fri, 5 Dec 2025 13:48:44 -0400 Subject: Fix pgo stresser getting stalled on CI --- scripts/lua/pgo.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'scripts/lua') diff --git a/scripts/lua/pgo.lua b/scripts/lua/pgo.lua index 2650686b..906bfd42 100644 --- a/scripts/lua/pgo.lua +++ b/scripts/lua/pgo.lua @@ -45,6 +45,15 @@ local View = require "core.view" local CWD = system.getcwd() +-- Allow printing to terminal when no video +if os.getenv("SDL_VIDEO_DRIVER") == "dummy" then + local core_log = core.log + core.log = function(text, ...) + core_log(text, ...) + print(string.format(text, ...)) + end +end + ---Helper for the fetch resource function. ---@param curl process ---@param callback? fun(percent,total,dowloaded,speed,left,elapsed) @@ -502,8 +511,10 @@ end -- Max execution time check (allow a maximum of 5 minutes to prevent endless CI) local start_time = os.time() -core.add_thread(function() +core.add_background_thread(function() while true do + -- allow to keep running even if unfocus + core.redraw = true coroutine.yield(1) if os.time() - start_time >= 5 * 60 then print "Maximum pgo stress time exceeded, quitting..." -- cgit v1.2.3