[tracker/tracker-1.0] functional-tests: Tweaks to process helpers



commit 5cb0c84751d1734a95e833ba875f23fc601241f4
Author: Sam Thursfield <sam afuera me uk>
Date:   Thu Jul 31 14:02:33 2014 +0100

    functional-tests: Tweaks to process helpers
    
    Note the bug I found where if you send TERM to tracker-extract while it's
    initialising, it hangs. I'll fix this in a separate commit.

 tests/functional-tests/common/utils/helpers.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/tests/functional-tests/common/utils/helpers.py b/tests/functional-tests/common/utils/helpers.py
index 508ee38..32c09db 100644
--- a/tests/functional-tests/common/utils/helpers.py
+++ b/tests/functional-tests/common/utils/helpers.py
@@ -106,6 +106,8 @@ class Helper:
                 FNULL = open ('/dev/null', 'w')
                 kws = { 'stdout': FNULL, 'stderr': FNULL }
 
+            command = [path] + flags
+            log ("Starting %s" % ' '.join(command))
             return subprocess.Popen ([path] + flags, **kws)
 
     def _stop_process (self):
@@ -114,6 +116,14 @@ class Helper:
                 print ("Kill %s manually" % self.PROCESS_NAME)
                 self.loop.run ()
         else:
+            # FIXME: this can hang if the we try to terminate the
+            # process too early in its lifetime ... if you see:
+            #
+            #   GLib-CRITICAL **: g_main_loop_quit: assertion 'loop != NULL' failed
+            #
+            # This means that the signal_handler() function was called
+            # before the main loop was started and the process failed to
+            # terminate.
             self.process.terminate ()
             self.process.wait ()
         return False
@@ -165,6 +175,7 @@ class Helper:
                                                               dbus_interface="org.freedesktop.DBus")
 
         self.process = self._start_process ()
+        log ('[%s] Started process %i' % (self.PROCESS_NAME, self.process.pid))
 
         self.process_watch_timeout = GLib.timeout_add (200, self._process_watch_cb)
 


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