Merge pull request #65659 from s0undt3ch/hotfix/coverage

[3006.x] Stop trying when codecov replies with `Too many uploads to this commit`
This commit is contained in:
David Murphy 2023-12-05 11:07:40 -07:00 committed by GitHub
commit 2efde6f0ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1214,8 +1214,22 @@ def upload_coverage(ctx: Context, reports_path: pathlib.Path, commit_sha: str =
"--flags", "--flags",
flags, flags,
check=False, check=False,
capture=True,
) )
stdout = ret.stdout.strip().decode()
stderr = ret.stderr.strip().decode()
if ret.returncode == 0: 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 break
if current_attempt >= max_attempts: if current_attempt >= max_attempts: