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 <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39134>
This commit is contained in:
Sergi Blanch Torne 2026-01-03 00:15:35 +01:00 committed by Marge Bot
parent 4384099bc2
commit 9864e9b70d

View file

@ -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: