summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_linux.py11
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_mac.py11
2 files changed, 11 insertions, 11 deletions
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
index b37f0bf..0ea0bec 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
@@ -7,6 +7,7 @@
import os
import re
+import signal
import subprocess
import sys
@@ -146,17 +147,11 @@ class PlatformUtility(object):
"""
# server_process is not set when "http_server.py stop" is run manually.
if server_process is None:
- # Try to determine the HTTP server process.
# TODO(mmoss) This isn't ideal, since it could conflict with lighttpd
# processes not started by http_server.py, but good enough for now.
- proc = subprocess.Popen(('ps', '--no-headers', '-o', 'pid',
- '-C', 'lighttpd'),
- stdout=subprocess.PIPE)
- pid = proc.stdout.readline().strip()
+ subprocess.call(['killall', '-u', os.getenv('USER'), '-TERM', 'lighttpd'])
else:
- pid = server_process.pid
- subprocess.Popen(('kill', '-TERM', '%s' % pid), stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).wait()
+ os.kill(server_process.pid, signal.SIGTERM)
def WDiffExecutablePath(self):
"""Path to the WDiff executable, which we assume is already installed and
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_mac.py b/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
index fd0e725..82dfcb1 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
@@ -7,6 +7,7 @@
import os
import re
+import signal
import subprocess
import sys
@@ -123,9 +124,13 @@ class PlatformUtility(object):
Args:
server_process: The subprocess object representing the running server
"""
- subprocess.Popen(('kill', '-TERM', '%d' % server_process.pid),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).wait()
+ # server_process is not set when "http_server.py stop" is run manually.
+ if server_process is None:
+ # TODO(mmoss) This isn't ideal, since it could conflict with lighttpd
+ # processes not started by http_server.py, but good enough for now.
+ subprocess.call(['killall', '-u', os.getenv('USER'), '-TERM', 'lighttpd'])
+ else:
+ os.kill(server_process.pid, signal.SIGTERM)
def WDiffExecutablePath(self):
"""Path to the WDiff executable, which we assume is already installed and