All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Strahinja Jankovic" <strahinja.p.jankovic@gmail.com>,
	"Niek Linnenbank" <nieklinnenbank@gmail.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-s390x@nongnu.org, qemu-arm@nongnu.org,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	qemu-ppc@nongnu.org, "Thomas Huth" <th.huth+qemu@posteo.eu>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Eric Farman" <farman@linux.ibm.com>
Subject: [PATCH 10/12] tests/functional: always raise AssetError when download fails
Date: Fri, 20 Nov 2026 12:14:56 +0000	[thread overview]
Message-ID: <20261120121458.3723625-11-berrange@redhat.com> (raw)
In-Reply-To: <20261120121458.3723625-1-berrange@redhat.com>

If two processes are downloading the same file, the second will
wait for the first to finish. The second may encounter problems,
however, and raise FileNotFoundError or TimeoutError. The layers
up the stack, however, only expect/handle AssetError.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/asset.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 5a9a0f37e9a..313efcf7626 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -103,7 +103,9 @@ def _wait_for_other_download(self, tmp_cache_file):
         except:
             if os.path.exists(self.cache_file):
                 return True
-            raise
+            raise AssetError(
+                self, f"Other thread failed download to {tmp_cache_file}",
+                transient=True)
         waittime = lastchange = 600
         while waittime > 0:
             sleep(1)
@@ -113,7 +115,9 @@ def _wait_for_other_download(self, tmp_cache_file):
             except:
                 if os.path.exists(self.cache_file):
                     return True
-                raise
+                raise AssetError(
+                    self, f"Other thread failed download to {tmp_cache_file}",
+                    transient=True)
             if new_size != current_size:
                 lastchange = waittime
                 current_size = new_size
@@ -121,7 +125,8 @@ def _wait_for_other_download(self, tmp_cache_file):
                 return False
 
         self.log.debug("Time out while waiting for %s!", tmp_cache_file)
-        raise TimeoutError(f"Time out while waiting for {tmp_cache_file}")
+        raise AssetError(f"Time out while waiting for {tmp_cache_file}",
+                         transient=True)
 
     def _save_time_stamp(self):
         '''
-- 
2.56.1



  parent reply	other threads:[~2026-11-20 12:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 01/12] tests/functional: update to newer sunxi kernel package Daniel P. Berrangé
2026-11-20 15:17   ` Thomas Huth
2026-11-20 12:14 ` [PATCH 02/12] tests/functional: update sha digests for tuxrun kernels Daniel P. Berrangé
2026-11-20 12:23   ` Marc-André Lureau
2026-11-20 12:14 ` [PATCH 03/12] tests/functional: update URL to rs6000 firmware Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 04/12] tests/functional: add Accept header when downloading assets Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 05/12] tests/functional: check if we are served an Anubis challenge Daniel P. Berrangé
2026-11-20 13:01   ` BALATON Zoltan
2026-11-20 13:06     ` BALATON Zoltan
2026-11-20 12:14 ` [PATCH 06/12] tests/functional: don't write timestamp unless successful Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 07/12] tests/functional: delete tmp file on interrupt Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 08/12] tests/functional: honour make jobs in precache Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 09/12] tests/functional: don't display stack trace on download fail Daniel P. Berrangé
2026-11-20 12:14 ` Daniel P. Berrangé [this message]
2026-11-20 12:14 ` [PATCH 11/12] tests/functional: only run pre-cache once per class Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 12/12] tests/functional: optionally display download progress Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120121458.3723625-11-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=farman@linux.ibm.com \
    --cc=hpoussin@reactos.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=mst@redhat.com \
    --cc=nieklinnenbank@gmail.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=strahinja.p.jankovic@gmail.com \
    --cc=th.huth+qemu@posteo.eu \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.