]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional/asset: Fail assert fetch when retries are exceeded
authorNicholas Piggin <npiggin@gmail.com>
Wed, 12 Mar 2025 13:00:00 +0000 (23:00 +1000)
committerThomas Huth <thuth@redhat.com>
Wed, 12 Mar 2025 17:20:50 +0000 (18:20 +0100)
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é <berrange@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20250312130002.945508-2-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/functional/qemu_test/asset.py

index f0730695f09c62df4a50a9b62fa056ce2df2d8c8..27dd839e705f6b31ad96f5541a101be7e79cd4dd 100644 (file)
@@ -138,6 +138,9 @@ class Asset:
                 tmp_cache_file.unlink()
                 raise
 
+        if not os.path.exists(tmp_cache_file):
+            raise Exception("Retries exceeded downloading %s", self.url)
+
         try:
             # Set these just for informational purposes
             os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",