bin/ci: crnm: bug stress mode retry formula

The execution_times structure was filled the same way in all the cases of an
if. As a side effect, the retry evaluation doesn't include the last result and
can lead, as a race condition, into triggering one extra time than the
indication in the stress argument.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33750>
This commit is contained in:
Sergi Blanch Torne 2025-04-17 23:50:01 +02:00 committed by Marge Bot
parent e6843c1705
commit 48bccb7d55

View file

@ -122,17 +122,16 @@ def run_target_job(
target_statuses: dict,
name_field_pad: int,
) -> None:
execution_times[job.name][job.id] = (job_duration(job), job.status, job.web_url)
if stress and job.status in COMPLETED_STATUSES:
if (
stress < 0
or len(execution_times[job.name]) < stress
):
execution_times[job.name][job.id] = (job_duration(job), job.status, job.web_url)
enable_job_fn(job=job, action_type="retry")
# Wait for the next loop to get the updated job object
return
else:
execution_times[job.name][job.id] = (job_duration(job), job.status, job.web_url)
enable_job_fn(job=job, action_type="target")
print_job_status(job, job.status not in target_statuses[job.name], name_field_pad)