Skip to content

Commit

Permalink
test: Fix device race condition in testAddDiskCustomPath
Browse files Browse the repository at this point in the history
Wait until the auto-detection of the disk format for an iso file is
finished before setting it. Otherwise it could happen that the
auto-detection changes the value after the test.
  • Loading branch information
martinpitt authored and KKoukiou committed Nov 29, 2023
1 parent 6024303 commit db53620
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/check-machines-disks
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,9 @@ class TestMachinesDisks(VirtualMachinesCase):
# Type in file path
b.set_file_autocomplete_val(f"#vm-{self.vm_name}-disks-adddisk-file", self.file_path)
if self.device:
if self.file_path.endswith(".iso"):
# wait for auto-detection to finish
b.wait_val(f"#vm-{self.vm_name}-disks-adddisk-select-device", "cdrom")
b.select_from_dropdown(f"#vm-{self.vm_name}-disks-adddisk-select-device", self.device)
elif self.mode == "use-existing":
b.wait_visible(f"#vm-{self.vm_name}-disks-adddisk-existing-select-pool:enabled")
Expand Down

0 comments on commit db53620

Please sign in to comment.