Skip to content

Commit a5e8299

Browse files
npigginhuth
authored andcommitted
tests/functional/asset: Fail assert fetch when retries are exceeded
Currently the fetch code does not fail gracefully when retry limit is exceeded, it just falls through the loop with no file, which ends up hitting other errors. Add a check for non-existing file, which indicates the retry limit was exceeded. Reviewed-by: Daniel P. Berrangé <[email protected]> Signed-off-by: Nicholas Piggin <[email protected]> Message-ID: <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent 15ef93d commit a5e8299

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/functional/qemu_test/asset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ def fetch(self):
138138
tmp_cache_file.unlink()
139139
raise
140140

141+
if not os.path.exists(tmp_cache_file):
142+
raise Exception("Retries exceeded downloading %s", self.url)
143+
141144
try:
142145
# Set these just for informational purposes
143146
os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",

0 commit comments

Comments
 (0)