Skip to content

Commit

Permalink
DBG - testUsed UDisks2 timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer committed Nov 6, 2023
1 parent 2715d4d commit e356e53
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/run
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ case "${TEST_SCENARIO:=}" in
PREPARE_OPTS="$PREPARE_OPTS --quick"
;;&
*storage*)
RUN_OPTS="$RUN_OPTS $(echo "$ALL_TESTS" | grep -E "$RE_STORAGE")"
RUN_OPTS="$RUN_OPTS TestStorageUsed"
PREPARE_OPTS="$PREPARE_OPTS --quick"
;;&
*expensive*)
Expand Down
39 changes: 37 additions & 2 deletions test/verify/check-storage-used
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import testlib
@testlib.nondestructive
class TestStorageUsed(storagelib.StorageCase):

def testUsed(self):
def checkUsed(self):
m = self.machine
b = self.browser

Expand Down Expand Up @@ -89,12 +89,47 @@ ExecStart=/usr/bin/sleep infinity
b.wait_visible("#dialog tbody:first-of-type button:contains(Currently in use)")
b.assert_pixels('#dialog', "format-disk")
self.dialog_apply()
self.dialog_wait_close()
try:
self.dialog_wait_close()
except testlib.Error:
if "Timed out waiting for object" in b.text("#dialog"):
# Sometimes /dev/sda1 is still held open by something
# immediately after locking it. the prevents the
# kernel from reading the new partition table. Let's
# just try again.
print("WARNING: Retrying partition table creation")
b.dialog_cancel()
self.dialog_wait_close()
b.click('button:contains(Create partition table)')
self.confirm()
else:
raise

m.execute("! systemctl --quiet is-active keep-mnt-busy")

self.content_row_wait_in_col(1, 0, "Free space")

def testUsed1(self):
self.checkUsed()

def testUsed2(self):
self.checkUsed()

def testUsed3(self):
self.checkUsed()

def testUsed4(self):
self.checkUsed()

def testUsed5(self):
self.checkUsed()

def testUsed6(self):
self.checkUsed()

def testUsed7(self):
self.checkUsed()

def testUsedAsPV(self):
m = self.machine
b = self.browser
Expand Down

0 comments on commit e356e53

Please sign in to comment.