From 6b49ea670bcf2bd61954c01d001f812578dc5c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 9 Dec 2024 01:33:12 +0100 Subject: [PATCH] tests: fix race condition in updates test Wait for the local repo to become available - python3 -m http may take a moment, and if the other parts are quick, the test would fail on connection refused error. --- qubes/tests/integ/vm_update.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qubes/tests/integ/vm_update.py b/qubes/tests/integ/vm_update.py index 52dce3e6a..3d661b2db 100644 --- a/qubes/tests/integ/vm_update.py +++ b/qubes/tests/integ/vm_update.py @@ -409,6 +409,13 @@ def create_repo_and_serve(self): "Template {} not supported by this test".format(self.template) ) + # wait for the repo to become reachable + self.loop.run_until_complete( + self.netvm_repo.run_for_stdio( + "while ! curl http://localhost:8080/ >/dev/null; do sleep 0.5; done" + ) + ) + def add_update_to_repo(self): """ :type self: qubes.tests.SystemTestCase | VmUpdatesMixin