Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Issue 10960050: Remove 'shell=True' in Popen and directly execute testserver.py (Closed)

Created:
8 years, 3 months ago by Shouqun Liu
Modified:
8 years, 3 months ago
CC:
chromium-reviews, peter+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

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.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=158267

Patch Set 1 #

Patch Set 2 : remove shell=True #

Total comments: 1

Patch Set 3 : update the patch #

Total comments: 1

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -6 lines) Patch
M build/android/pylib/chrome_test_server_spawner.py View 1 2 3 1 chunk +4 lines, -6 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Shouqun Liu
Hi all, this patch fixes the issue caused by Popen (http://stackoverflow.com/questions/6742635/popen-creates-an-extra-sh-process), Using subprocess.Popen with "shell=True" ...
8 years, 3 months ago (2012-09-24 06:24:57 UTC) #1
Isaac (away)
It is surprising to me that linux does not kill a child when the parent ...
8 years, 3 months ago (2012-09-24 06:49:56 UTC) #2
Isaac (away)
Sorry for the mangled grammer. I suggest you remove shell=True and execute testserver.py directly.
8 years, 3 months ago (2012-09-24 06:51:08 UTC) #3
Shouqun Liu
On 2012/09/24 06:51:08, Isaac wrote: > Sorry for the mangled grammer. > > I suggest ...
8 years, 3 months ago (2012-09-24 07:07:29 UTC) #4
Isaac (away)
http://codereview.chromium.org/10960050/diff/4003/build/android/pylib/chrome_test_server_spawner.py File build/android/pylib/chrome_test_server_spawner.py (right): http://codereview.chromium.org/10960050/diff/4003/build/android/pylib/chrome_test_server_spawner.py#newcode216 build/android/pylib/chrome_test_server_spawner.py:216: args = shlex.split(command) Thanks! We might be able to ...
8 years, 3 months ago (2012-09-24 07:30:46 UTC) #5
Shouqun Liu
On 2012/09/24 07:30:46, Isaac wrote: > http://codereview.chromium.org/10960050/diff/4003/build/android/pylib/chrome_test_server_spawner.py > File build/android/pylib/chrome_test_server_spawner.py (right): > > http://codereview.chromium.org/10960050/diff/4003/build/android/pylib/chrome_test_server_spawner.py#newcode216 > ...
8 years, 3 months ago (2012-09-24 07:48:52 UTC) #6
Isaac (away)
LGTM
8 years, 3 months ago (2012-09-24 08:04:11 UTC) #7
bulach
lgtm, one nit below. also, patch description will need updating :) thanks! http://codereview.chromium.org/10960050/diff/5003/build/android/pylib/chrome_test_server_spawner.py File build/android/pylib/chrome_test_server_spawner.py ...
8 years, 3 months ago (2012-09-24 10:28:02 UTC) #8
Shouqun Liu
On 2012/09/24 10:28:02, bulach wrote: > lgtm, one nit below. also, patch description will need ...
8 years, 3 months ago (2012-09-24 11:19:32 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shouqun.liu@intel.com/10960050/9002
8 years, 3 months ago (2012-09-24 11:43:46 UTC) #10
commit-bot: I haz the power
8 years, 3 months ago (2012-09-24 13:38:42 UTC) #11
Change committed as 158267

Powered by Google App Engine
This is Rietveld 408576698