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 07/12] tests/functional: delete tmp file on interrupt
Date: Fri, 20 Nov 2026 12:14:53 +0000	[thread overview]
Message-ID: <20261120121458.3723625-8-berrange@redhat.com> (raw)
In-Reply-To: <20261120121458.3723625-1-berrange@redhat.com>

If the user interrupts the download, delete the temporary
file so we don't get a long timeout waiting on a stale
download when re-running.

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

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 51c76993d07..5a9a0f37e9a 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -225,8 +225,12 @@ def fetch(self):
         self.log.info("Downloading %s to %s...", self.url, self.cache_file)
         tmp_cache_file = self.cache_file.with_suffix(".download")
 
-        if self._try_to_fetch(tmp_cache_file):
-            return str(self.cache_file)
+        try:
+            if self._try_to_fetch(tmp_cache_file):
+                return str(self.cache_file)
+        except KeyboardInterrupt:
+            tmp_cache_file.unlink()
+            raise
 
         if not os.path.exists(tmp_cache_file):
             raise AssetError(self, "Download retries exceeded", transient=True)
-- 
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 ` Daniel P. Berrangé [this message]
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 ` [PATCH 10/12] tests/functional: always raise AssetError when download fails Daniel P. Berrangé
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-8-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.