ci,crnm: refresh_wait_job as argument
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

The polling period of the monitoring loop is a constant hardcoded and defined
to an arbitrary default number. This is related to the output reporting to the
user the progress in the pipeline running, so it shows this tool is alive when
it can be generating a huge number of output lines. Transforming it to a
definable variable allows the possibility to experiment with different values,
because of the balance between when a job can be triggered and the verbose
output produced.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39105>
This commit is contained in:
Sergi Blanch Torne 2025-12-29 23:06:56 +01:00 committed by Marge Bot
parent f94530e8c6
commit 411110f738

View file

@ -146,6 +146,7 @@ def monitor_pipeline(
dependencies: set[str],
stress: int,
inhibit_single_target_trace: int = False,
polling_period: int = REFRESH_WAIT_JOBS,
) -> tuple[Optional[int], Optional[int], Dict[str, Dict[int, Tuple[float, str, str]]]]:
"""Monitors pipeline and delegate canceling jobs"""
statuses: dict[str, str] = defaultdict(str)
@ -239,13 +240,13 @@ def monitor_pipeline(
enough = False
if not enough:
pretty_wait(REFRESH_WAIT_JOBS)
pretty_wait(polling_period)
continue
if jobs_waiting:
print(f"[yellow]Waiting for jobs to update status:")
print_formatted_list(jobs_waiting, indentation=8, color="[yellow]")
pretty_wait(REFRESH_WAIT_JOBS)
pretty_wait(polling_period)
continue
if (
@ -274,7 +275,7 @@ def monitor_pipeline(
if skip_follow_statuses.issuperset(target_statuses.values()):
return None, 0, execution_times
pretty_wait(REFRESH_WAIT_JOBS)
pretty_wait(polling_period)
def enable_job(
@ -514,6 +515,13 @@ def parse_args() -> argparse.Namespace:
action="store_true",
help="When there is only one target job, inhibit the job trace output in the console.",
)
parser.add_argument(
"--polling-period",
type=int,
default=REFRESH_WAIT_JOBS,
help=f"Specify the waiting seconds between monitor loops. (Default: {REFRESH_WAIT_JOBS})",
)
mutex_group1 = parser.add_mutually_exclusive_group()
mutex_group1.add_argument(
@ -780,6 +788,7 @@ def main() -> None:
deps,
args.stress,
args.no_job_log,
args.polling_period,
)
if target_job_id: