From fa6aa9f42faac78aefee98af3a536ae7113ab61e Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 22 Oct 2025 12:10:22 +0200 Subject: [PATCH] ci: Retry image building once on failure The build scripts inside the image retry after a failure. However, there may be some rare network failures inside the container engine. For example, when pulling the underlying base image, or when pulling the docker cache. Thus, retry after a failure once, which should hopefully fix https://github.com/bitcoin/bitcoin/issues/33640. --- ci/test/02_run_container.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci/test/02_run_container.py b/ci/test/02_run_container.py index 7b1e3e0e496..2f15f27a345 100755 --- a/ci/test/02_run_container.py +++ b/ci/test/02_run_container.py @@ -7,6 +7,7 @@ import os import shlex import subprocess import sys +import time def run(cmd, **kwargs): @@ -65,7 +66,10 @@ def main(): cmd_build += [os.environ["BASE_READ_ONLY_DIR"]] print(f"Building {os.environ['CONTAINER_NAME']} image tag to run in") - run(cmd_build) + if run(cmd_build, check=False).returncode != 0: + print(f"Retry building {os.environ['CONTAINER_NAME']} image tag after failure") + time.sleep(3) + run(cmd_build) run(["./ci/test/02_run_container.sh"]) # run the remainder