[gnome-bluetooth/wip/hadess/faster-tests] tests: Make tests faster




commit d1cb796fd6bdbbf5ea07dd179a0869e5fe5f831b
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 20 14:36:38 2022 +0100

    tests: Make tests faster
    
    By using smaller timeouts when waiting for events on the mainloop.

 tests/integration-test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/integration-test.py b/tests/integration-test.py
index 543f3876..39000499 100755
--- a/tests/integration-test.py
+++ b/tests/integration-test.py
@@ -77,7 +77,7 @@ class OopTests(dbusmock.DBusTestCase):
 
     def wait_for_mainloop(self):
         ml = GLib.MainLoop()
-        GLib.timeout_add_seconds(1, ml.quit)
+        GLib.timeout_add(100, ml.quit)
         ml.run()
 
     def wait_for_condition(self, condition, timeout=5):
@@ -86,7 +86,7 @@ class OopTests(dbusmock.DBusTestCase):
         def timeout_cb():
             nonlocal timed_out
             timed_out = True
-        GLib.timeout_add_seconds(1, timeout_cb)
+        GLib.timeout_add(100, timeout_cb)
         while not condition() and not timed_out:
           ctx.iteration(True)
 


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