From 8c5d91b8846f94e71cf475be4a6251643a132f03 Mon Sep 17 00:00:00 2001 From: Alison Shao <54658187+alisonshao@users.noreply.github.com> Date: Mon, 29 Dec 2025 23:55:49 -0800 Subject: [PATCH] Fix race condition in /tag-and-rerun-ci command (#16142) --- scripts/ci/slash_command_handler.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/ci/slash_command_handler.py b/scripts/ci/slash_command_handler.py index c63f75e0c..a69bf5c85 100644 --- a/scripts/ci/slash_command_handler.py +++ b/scripts/ci/slash_command_handler.py @@ -1,6 +1,7 @@ import json import os import sys +import time import requests from github import Auth, Github @@ -301,6 +302,12 @@ def main(): tagged = handle_tag_run_ci( repo, pr, comment, user_perms, react_on_success=False ) + + # Wait for the label to propagate before triggering rerun + if tagged: + print("Waiting 5 seconds for label to propagate...") + time.sleep(5) + rerun = handle_rerun_failed_ci( repo, pr, comment, user_perms, react_on_success=False )