Skip to content

Commit

Permalink
test: Fix race condition in testCreateDownloadAnOS()
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.
  • Loading branch information
martinpitt committed Jul 15, 2024
1 parent 5b427b5 commit b03a9d0
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)

# wait for virt-install to finish
if 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 b03a9d0

Please sign in to comment.