[dbus PATCH] tests: Avoid hidding TimeoutError in main loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently the error was not propagated from the timeout
handler properly, and we had PASSED tests even with
timeouts.

Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 test/libvirttest.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/libvirttest.py b/test/libvirttest.py
index 7168e66..d1b71cc 100644
--- a/test/libvirttest.py
+++ b/test/libvirttest.py
@@ -60,11 +60,14 @@ class BaseTestClass():
         def timeout():
             self.loop.quit()
             del self.loop
-            raise TimeoutError()
+            self.timeout = True
 
+        self.timeout = False
         self.loop = GLib.MainLoop()
         GLib.timeout_add(2000, timeout)
         self.loop.run()
+        if self.timeout:
+            raise TimeoutError()
 
     def domain(self):
         path = self.connect.ListDomains(0)[0]
-- 
2.15.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux