summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorshouqun.liu@intel.com <shouqun.liu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-24 13:38:40 +0000
committershouqun.liu@intel.com <shouqun.liu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-24 13:38:40 +0000
commit4d6d119a481d6db0a0d8a5241398db8705512cf1 (patch)
tree702f6ba0035542f9565f4711976f9fd83ca3b91b /build
parent5aa219ccc18c4da9966af1ccbca5f1a0492b83f4 (diff)
downloadchromium_src-4d6d119a481d6db0a0d8a5241398db8705512cf1.zip
chromium_src-4d6d119a481d6db0a0d8a5241398db8705512cf1.tar.gz
chromium_src-4d6d119a481d6db0a0d8a5241398db8705512cf1.tar.bz2
Remove 'shell=True' in Popen and directly execute testserver.py
In chrome_test_server_spawner.py, testserver process is created by 'subprocess.Popen(command, shell=True)', it will create 2 processes(http://goo.gl/oDYsn): (1) /bin/sh -c testserver.py ... (2) python testserver.py ... but subprocess.Popen only returns the 1st process(pid), so when kill testserver with Popen.kill(), only the 1st process is killed, the 2nd process(testserver) still remains there. This leads to two problems: (1) testserver failed to be killed for each case with the log: '"GET /kill HTTP/1.1" 500' (2) many teserver processes are there after each run, and the port is used, when starting a new run, will get the following error: 'socket.error: [Errno 98] Address already in use' Remove the 'shell=True' and fix this issue. BUG= TEST=net_unittests_apk --gtest_filter=URLRequestTestHTTP.* Review URL: https://chromiumcodereview.appspot.com/10960050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158267 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/android/pylib/chrome_test_server_spawner.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/build/android/pylib/chrome_test_server_spawner.py b/build/android/pylib/chrome_test_server_spawner.py
index 1766a773..512a609 100644
--- a/build/android/pylib/chrome_test_server_spawner.py
+++ b/build/android/pylib/chrome_test_server_spawner.py
@@ -207,12 +207,10 @@ class TestServerThread(threading.Thread):
logging.info('Start running the thread!')
self.wait_event.clear()
self._GenerateCommandLineArguments()
- command = '%s %s' % (
- os.path.join(constants.CHROME_DIR, 'net', 'tools', 'testserver',
- 'testserver.py'),
- ' '.join(self.command_line))
- logging.info(command)
- self.process = subprocess.Popen(command, shell=True)
+ command = [os.path.join(constants.CHROME_DIR, 'net', 'tools',
+ 'testserver', 'testserver.py')] + self.command_line
+ logging.info('Running: %s', command)
+ self.process = subprocess.Popen(command)
if self.process:
if self.pipe_out:
self.is_ready = self._WaitToStartAndGetPortFromTestServer()