Merge bitcoin/bitcoin#33915: test: Retry download in get_previous_releases.py

fad06f3bb4 test: retry download in get_previous_releases.py (MarcoFalke)

Pull request description:

  Hopefully fixes https://github.com/bitcoin/bitcoin/issues/33913 (intermittent download issues)

  If not, the diff there to cache the bins can be considered.

ACKs for top commit:
  davidgumberg:
    ACK fad06f3bb4
  achow101:
    ACK fad06f3bb4
  enirox001:
    ACK fad06f3
  TheCharlatan:
    ACK fad06f3bb4
  janb84:
    ACK fad06f3bb4

Tree-SHA512: 6597e993cc64259e361f65045a938e693b47ff73a7dc22f5a70b6c9890986817849915f90096e3b87684f25152a6d8ae4ec5480c326c32d36273cdb0a33ceb0c
This commit is contained in:
Ava Chow
2025-11-21 13:35:03 -08:00

View File

@@ -168,7 +168,13 @@ def download_binary(tag, args) -> int:
download_from_url(archive_url, archive)
except Exception as e:
print(f"\nDownload failed: {e}", file=sys.stderr)
return 1
print("Retrying download after failure ...", file=sys.stderr)
time.sleep(12)
try:
download_from_url(archive_url, archive)
except Exception as e2:
print(f"\nDownload failed a second time: {e2}", file=sys.stderr)
return 1
hasher = hashlib.sha256()
with open(archive, "rb") as afile: