diff options
| author | Daniel P. Berrangé <berrange@redhat.com> | 2025-09-18 13:57:45 +0100 |
|---|---|---|
| committer | Thomas Huth <thuth@redhat.com> | 2025-09-24 08:26:11 +0200 |
| commit | bcc251800b9e60c541de860dc8a1ced70622ee43 (patch) | |
| tree | 4398c53e4b058ce2780dd892bc23f1a1f3ad847d /tests/functional/qemu_test/asset.py | |
| parent | 4f1ebc7712a7db61155080164f2169320d033559 (diff) | |
| download | focaccia-qemu-bcc251800b9e60c541de860dc8a1ced70622ee43.tar.gz focaccia-qemu-bcc251800b9e60c541de860dc8a1ced70622ee43.zip | |
tests/functional: retry when seeing ConnectionError exception
This base class is used for many different socket connection errors, corresponding to ECONNRESET, ECONNREFUSED, ECONNABORTED and more. Most of these are things you might expect to see every now and then as transient flaws. We should thus retry the asset download when seeing them. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250918125746.1165658-2-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to '')
| -rw-r--r-- | tests/functional/qemu_test/asset.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py index 2dd32bf28d..f8b87d2153 100644 --- a/tests/functional/qemu_test/asset.py +++ b/tests/functional/qemu_test/asset.py @@ -179,6 +179,13 @@ class Asset: self.url, e.reason) raise AssetError(self, "Unable to download: URL error %s" % e.reason, transient=True) + except ConnectionError as e: + # A socket connection failure, such as dropped conn + # or refused conn + tmp_cache_file.unlink() + self.log.error("Unable to download %s: Connection error %s", + self.url, e) + continue except Exception as e: tmp_cache_file.unlink() raise AssetError(self, "Unable to download: %s" % e) |