From 32c950d16e7bea55bb7af3f4650af857be9027e0 Mon Sep 17 00:00:00 2001 From: drebs Date: Wed, 1 Mar 2017 21:02:41 -0300 Subject: [test] improve twistd startup and termination - use subprocess.check_call() to ensure any errors during twistd startup will properly show up on test reports. - use SIGTERM instead of SIGKILL to gracefully terminate twistd. --- testing/tests/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/tests/conftest.py b/testing/tests/conftest.py index 49cc35f6..c077828f 100644 --- a/testing/tests/conftest.py +++ b/testing/tests/conftest.py @@ -6,7 +6,7 @@ import signal import time from hashlib import sha512 -from subprocess import call +from subprocess import check_call from urlparse import urljoin from uuid import uuid4 @@ -98,7 +98,7 @@ class SoledadServer(object): def start(self): self._create_conf_file() # start the server - call([ + check_call([ 'twistd', '--logfile=%s' % self._logfile, '--pidfile=%s' % self._pidfile, @@ -118,7 +118,7 @@ class SoledadServer(object): def stop(self): pid = get_pid(self._pidfile) - os.kill(pid, signal.SIGKILL) + os.kill(pid, signal.SIGTERM) @pytest.fixture(scope='module') -- cgit v1.2.3