Skip to content

Commit

Permalink
test: Fix race condition in testCreateDownloadAnOS() on tumbleweed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinpitt authored and mvollmer committed Jul 16, 2024
1 parent 4220d14 commit caf5936
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/check-machines-create
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit caf5936

Please sign in to comment.