ci,crnm: inhibit pretty_wait within a GitLab job

Added in 411110f7 as part of !39105 an argument to define the polling period
to monitor a pipeline and check if there are jobs to be enabled. Part of this
MR, 8cf2c50e, also includes changes to improve the experience when using this
tool within a GitLab job. But the pretty_wait method, meant to show a
heartbeat to the user, is disturbing the job traces as '\r' is useless in a
non-terminal console.

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-02 23:32:26 +01:00 committed by Marge Bot
parent 2a1b9d7a09
commit 4384099bc2

View file

@ -111,6 +111,9 @@ def job_duration(job: gitlab.v4.objects.ProjectPipelineJob) -> float:
def pretty_wait(sec: int) -> None:
"""shows progressbar in dots"""
if is_gitlab_job():
time.sleep(sec)
return
for val in range(sec, 0, -1):
print(f"{val:2d} seconds", end="\r") # U+23F2 Timer clock
time.sleep(1)