From: Tony Asleson <tasleson@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - lvmdbustest: Test job remove path when job not complete
Date: Thu, 30 Jun 2022 16:00:48 +0000 (GMT) [thread overview]
Message-ID: <20220630160048.49386386F0D4@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=55059e002abb3d858e4c53ac0da078ca853ff1f4
Commit: 55059e002abb3d858e4c53ac0da078ca853ff1f4
Parent: d393436727014b9eddf71009065f65a59ff3837c
Author: Tony Asleson <tasleson@redhat.com>
AuthorDate: Mon Jun 6 09:58:39 2022 -0500
Committer: Tony Asleson <tasleson@redhat.com>
CommitterDate: Thu Jun 30 10:55:16 2022 -0500
lvmdbustest: Test job remove path when job not complete
---
test/dbus/lvmdbustest.py | 11 +++++++++++
1 file changed, 11 insertions(+)
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)
reply other threads:[~2022-06-30 16:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220630160048.49386386F0D4@sourceware.org \
--to=tasleson@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.