From e242ae3bf2cad105acbd9d679e7b5a9c82fedecd Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 4 Dec 2023 16:40:44 +0000 Subject: [PATCH] Stop trying when codecov replies with `Too many uploads to this commit` Signed-off-by: Pedro Algarvio --- tools/ci.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/ci.py b/tools/ci.py index 9add8826907..e4ef802d9f2 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -1214,8 +1214,22 @@ def upload_coverage(ctx: Context, reports_path: pathlib.Path, commit_sha: str = "--flags", flags, check=False, + capture=True, ) + stdout = ret.stdout.strip().decode() + stderr = ret.stderr.strip().decode() if ret.returncode == 0: + ctx.console_stdout.print(stdout) + ctx.console.print(stderr) + break + + if ( + "Too many uploads to this commit" in stdout + or "Too many uploads to this commit" in stderr + ): + # Let's just stop trying + ctx.console_stdout.print(stdout) + ctx.console.print(stderr) break if current_attempt >= max_attempts: