summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2022-06-06 09:58:39 -0500
committerTony Asleson <tasleson@redhat.com>2022-06-30 10:55:16 -0500
commit55059e002abb3d858e4c53ac0da078ca853ff1f4 (patch)
treec155049cd58b785662e23baec90f21096cdfcc48
parentd393436727014b9eddf71009065f65a59ff3837c (diff)
downloadlvm2-55059e002abb3d858e4c53ac0da078ca853ff1f4.tar.gz
lvmdbustest: Test job remove path when job not complete
-rwxr-xr-xtest/dbus/lvmdbustest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index d876a1748..e16a484b7 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -886,8 +886,19 @@ class TestDbusService(unittest.TestCase):
j.Remove()
break
+ else:
+ # Most of the time we will get this exception as expected, but there is
+ # a race condition between checking if it's complete and removing it (we want to try to remove while
+ # it's not complete to raise the exception)
+ # Thus, we can't reliably use self.assertRaises.
+ # We have included it here to test this path in the daemon.
+ try:
+ j.Remove()
+ except dbus.exceptions.DBusException:
+ pass
if j.Wait(1):
+ self.assertTrue(j.Wait(0))
j.update()
self.assertTrue(j.Complete)