Skip to content

Commit

Permalink
test: Fix TestMachinesDisks.testAddDiskPool race
Browse files Browse the repository at this point in the history
Waiting for the defaultVol.iso volume to appear in the API isn't enough
-- it also needs to bubble trough libvirt-dbus and Redux. Wait until the
UI sees the volume before trying to select it in the "Add disk" dialog.
The dialog won't (and shouldn't) dynamically update the available
selections once its open.
  • Loading branch information
martinpitt authored and jelly committed Nov 21, 2023
1 parent abf4243 commit e774240
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/check-machines-disks
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,15 @@ class TestMachinesDisks(VirtualMachinesCase):
m.upload([os.path.join(BOTS_DIR, "machine/cloud-init.iso")], "/var/lib/libvirt/images/defaultVol.iso")
m.execute("virsh pool-refresh images")
wait(lambda: "defaultVol.iso" in m.execute("virsh vol-list images"), delay=3)

# wait until the volume bubbled through the UI
b.go("/machines#/storages")
self.waitPoolRow("images")
self.togglePoolRow("images")
b.click("tr[data-row-id=pool-images-system] + tr li:contains('Storage volumes') button")
b.wait_in_text("#storage-pools-listing", "defaultVol.iso")
b.go("/machines#vm?name=subVmTest1&connection=system")

dialog = self.VMAddDiskDialog(
self,
mode="use-existing",
Expand Down

0 comments on commit e774240

Please sign in to comment.