aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2025-12-05 13:48:44 -0400
committerjgmdev <jgmdev@gmail.com>2025-12-05 13:49:02 -0400
commitb044ce4cc806ddb01a86fb19b395475c8a01cc43 (patch)
tree3b186c8491e10ae9c01dbbcc3d3473055ef66621 /scripts
parent1cbb09c5646c16aefc49846e24bc7cfffdb558e2 (diff)
downloadpragtical-b044ce4cc806ddb01a86fb19b395475c8a01cc43.tar.gz
pragtical-b044ce4cc806ddb01a86fb19b395475c8a01cc43.zip
Fix pgo stresser getting stalled on CI
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lua/pgo.lua13
1 files changed, 12 insertions, 1 deletions
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..."