From: Thomas Huth <thuth@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] tests/functional: treat unknown exceptions as transient faults
Date: Thu, 18 Sep 2025 15:01:25 +0200 [thread overview]
Message-ID: <c42b22a2-31d1-443c-952e-e8439f333e45@redhat.com> (raw)
In-Reply-To: <20250918125746.1165658-3-berrange@redhat.com>
On 18/09/2025 14.57, Daniel P. Berrangé wrote:
> To maximise the robustness of the functional tests we want to treat most
> asset download failures as non-fatal to the test suite. Instead it
> should just skip the tests which need that particular asset. The only
> time aim to make it fatal is for 404 errors which are highly likely to
> reflect genuine problems to be fixed.
>
> We catch certain exception classes and handle them as transient errors,
> but unfortunately it is proving difficult to predict what exception
> classes urlopen() is capable of raising, with new possibilities being
> discovered.
>
> To provide a fail-safe, treat the generic Exception class as being a
> transient error too. This may well mask certain genuine bugs, but it is
> preferrable to prioritize running the test suite to the greatest extent
> practical.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> tests/functional/qemu_test/asset.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
> index f8b87d2153..2971a989d1 100644
> --- a/tests/functional/qemu_test/asset.py
> +++ b/tests/functional/qemu_test/asset.py
> @@ -188,7 +188,8 @@ def fetch(self):
> continue
> except Exception as e:
> tmp_cache_file.unlink()
> - raise AssetError(self, "Unable to download: %s" % e)
> + raise AssetError(self, "Unable to download: %s" % e,
> + transient=True)
>
> if not os.path.exists(tmp_cache_file):
> raise AssetError(self, "Download retries exceeded", transient=True)
Reviewed-by: Thomas Huth <thuth@redhat.com>
prev parent reply other threads:[~2025-09-18 13:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 12:57 [PATCH 0/2] tests/functional: more asset download robustness fixes Daniel P. Berrangé
2025-09-18 12:57 ` [PATCH 1/2] tests/functional: retry when seeing ConnectionError exception Daniel P. Berrangé
2025-09-18 12:59 ` Thomas Huth
2025-09-18 12:57 ` [PATCH 2/2] tests/functional: treat unknown exceptions as transient faults Daniel P. Berrangé
2025-09-18 13:01 ` Thomas Huth [this message]
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=c42b22a2-31d1-443c-952e-e8439f333e45@redhat.com \
--to=thuth@redhat.com \
--cc=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).