From 9864e9b70d8a80c769f435b86e3e70457f93ce74 Mon Sep 17 00:00:00 2001 From: Sergi Blanch Torne Date: Sat, 3 Jan 2026 00:15:35 +0100 Subject: [PATCH] ci,crnm: fix round error in pretty_duration When a time delta is a float, the minutes and seconds can produce a weird output between 0.5 and 0.9 with strings like 1m60s. Just forcing a cast to an integer, the bug is solved. Signed-off-by: Sergi Blanch Torne Part-of: --- bin/ci/gitlab_common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ci/gitlab_common.py b/bin/ci/gitlab_common.py index fd3b3337680..a4c1cfd534a 100644 --- a/bin/ci/gitlab_common.py +++ b/bin/ci/gitlab_common.py @@ -41,8 +41,9 @@ def print_once(*args, **kwargs): print(*args, **kwargs) -def pretty_duration(seconds): +def pretty_duration(seconds: int | float) -> str: """Pretty print duration""" + seconds = int(seconds) hours, rem = divmod(seconds, 3600) minutes, seconds = divmod(rem, 60) if hours: