[tracker] functional-tests: Tweaks to process helpers
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] functional-tests: Tweaks to process helpers
- Date: Thu, 31 Jul 2014 13:25:23 +0000 (UTC)
commit b08632393732b4a7b02f9166e4edfd25dd68000b
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]