From 966d41e47d9a87c0fe270d4e3350a3afa4277c5f Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 6 Nov 2023 11:57:37 +0200 Subject: [PATCH] DBG - testUsed UDisks2 timeout --- test/run | 2 +- test/verify/check-storage-used | 37 ++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/test/run b/test/run index f601b980c6bf..e10dda735514 100755 --- a/test/run +++ b/test/run @@ -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*) diff --git a/test/verify/check-storage-used b/test/verify/check-storage-used index 0b2e0ee85c64..f0771e7de457 100755 --- a/test/verify/check-storage-used +++ b/test/verify/check-storage-used @@ -24,7 +24,7 @@ import testlib @testlib.nondestructive class TestStorageUsed(storagelib.StorageCase): - def testUsed(self): + def checkUsed(self): m = self.machine b = self.browser @@ -89,12 +89,45 @@ 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") + self.dialog_apply() + self.dialog_wait_close() + 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