From caf5936b1444c80b80ed580e864382af792927b8 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 15 Jul 2024 13:26:29 +0200 Subject: [PATCH] test: Fix race condition in testCreateDownloadAnOS() on tumbleweed Wait for `virt-install` to finish, so that it doesn't race with the UI shutting down and deleting the VM. This takes *very* long on current OpenSUSE Tumbleweed unfortunately, but that's better than almost always failing. virt-install doesn't end at all anywhere else, so for now we have to restrict this hack to tumbleweed. --- test/check-machines-create | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/check-machines-create b/test/check-machines-create index e27e1d870..bb41444a0 100755 --- a/test/check-machines-create +++ b/test/check-machines-create @@ -1328,6 +1328,10 @@ vnc_password= "{vnc_passwd}" user_login = virt_install_cmd_out.split("user-login=", 1)[1].split(",")[0].rstrip() self.assertIn(user_login, self.user_login) + # HACK: wait for virt-install to finish; this only races on tumbleweed + if self.machine.image == 'opensuse-tumbleweed' and self.create_and_run: + self.machine.execute(f"while {virt_install_cmd}; do sleep 1; done", timeout=300) + def fill(self): b = self.browser if not self.name_generated: