diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2014-07-31 14:02:33 +0100 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2014-07-31 14:16:26 +0100 |
commit | b08632393732b4a7b02f9166e4edfd25dd68000b (patch) | |
tree | d867bc01a47105be777368c8051046037511c761 /tests/functional-tests | |
parent | dd0427d55ab3d5ef15e88a479653e53b652ae8e3 (diff) | |
download | tracker-b08632393732b4a7b02f9166e4edfd25dd68000b.tar.gz |
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.
Diffstat (limited to 'tests/functional-tests')
-rw-r--r-- | 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 508ee382e..32c09dbcd 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) |