From e50c76c0b5f9fecc383e320a8dc52517773f2e61 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Thu, 5 Sep 2024 10:39:01 +0200 Subject: [PATCH] [IMP] runbot: make stats when build timeout The stats are only kept when the build finishes, this makes sence to avoid collecting stats of a manually killed build (or because of newer build found), but the stats mays be interresting when the build timeouts. Adding a manual collection of stats in this case. --- runbot/models/build.py | 1 + 1 file changed, 1 insertion(+) diff --git a/runbot/models/build.py b/runbot/models/build.py index 86c9d7e5..49e15bb0 100644 --- a/runbot/models/build.py +++ b/runbot/models/build.py @@ -736,6 +736,7 @@ class BuildResult(models.Model): if _docker_state == 'RUNNING': timeout = min(build.active_step.cpu_limit, int(icp.get_param('runbot.runbot_timeout', default=10000))) if build.local_state != 'running' and build.job_time > timeout: + build.active_step._make_stats(build) build._log('_schedule', '%s time exceeded (%ss)' % (build.active_step.name if build.active_step else "?", build.job_time)) build._kill(result='killed') return False