summaryrefslogtreecommitdiff
path: root/test/dbus
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2022-08-09 17:36:54 -0500
committerTony Asleson <tasleson@redhat.com>2022-09-16 10:49:36 -0500
commitea45ba753eaa168429b9747500e6f31f2856890f (patch)
treec1f6c1655a22f237b4d65a8614fd417d8cc526a0 /test/dbus
parent3fdf4493481ff8baae2ac5416dce6d05b69e6b28 (diff)
downloadlvm2-ea45ba753eaa168429b9747500e6f31f2856890f.tar.gz
lvmdbustest: Remove force exception in _wait_for_job
We put this in to test one of the paths in the damon, but unfortunately if we hit the race condition where the job actually is done we will try to call j.Wait(1) after the remove. This fails with: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "Wait" with signature "i" on interface "com.redhat.lvmdbus1.Job" doesn't exist Which is caused by the dbus object no longer existing. We could handle this, but the issue is we no longer have the ability to get the result to return, they have been lost. A better solution would be to write a specific unit test to force this code path and handle all the possible outcomes.
Diffstat (limited to 'test/dbus')
-rwxr-xr-xtest/dbus/lvmdbustest.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 02d4d35d7..e7df238ce 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -900,16 +900,6 @@ 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))