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

Issue 24126005: Use CreateProcess instead of subprocess.Popen to launch Chrome in the mini_installer test framework. (Closed)

Created:
7 years, 3 months ago by sukolsak
Modified:
7 years, 3 months ago
CC:
chromium-reviews
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Use CreateProcess instead of subprocess.Popen to launch Chrome in the mini_installer test framework. When creating a new process using the subprocess module in Python, the parent process's stdout will never be closed until the child process exits. This caused the mini_installer test slave to time out since it waited for the stdout of python.exe to close, but chrome.exe was still running. See a sample error message at http://goo.gl/XUYlu3. Using Windows API "CreateProcess" fixes this issue. NOTRY=True BUG=264859 TEST= 1) Uninstall Chrome (if it's installed.) 2) Build Chrome with Release mode and make sure that mini_installer.exe is created. 3) Go to src\chrome\test\mini_installer 4) Create the following Python script: import subprocess command = ['python', 'test_installer.py', 'config\\config.config', r'--build-dir=<build-dir>', '--target=Release'] p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=0) f = p.stdout while f.read(1): pass print 'done' where <build-dir> is the path to main build directory (the parent of the Release directory). Then save it as test.py. 5) Run "python test.py". You should see "done" in the output. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=224256

Patch Set 1 #

Patch Set 2 : Use taskkill. #

Total comments: 1

Patch Set 3 : Remove taskkill. #

Total comments: 2

Patch Set 4 : Address gab's comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -3 lines) Patch
M chrome/test/mini_installer/launch_chrome.py View 1 2 3 2 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
sukolsak
Could you please take a look at this?
7 years, 3 months ago (2013-09-13 06:04:59 UTC) #1
robertshield
LGTM in the sense that I like that this avoids a non-obvious side effect of ...
7 years, 3 months ago (2013-09-13 12:55:12 UTC) #2
gab
Why is Chrome still running? That's a problem imo and I'm not sure we should ...
7 years, 3 months ago (2013-09-13 15:11:14 UTC) #3
sukolsak
On 2013/09/13 15:11:14, gab wrote: > Why is Chrome still running? That's a problem imo ...
7 years, 3 months ago (2013-09-13 15:48:36 UTC) #4
sukolsak
On 2013/09/13 15:48:36, sukolsak wrote: > On 2013/09/13 15:11:14, gab wrote: > > Why is ...
7 years, 3 months ago (2013-09-13 18:08:15 UTC) #5
grt (UTC plus 2)
lgtm
7 years, 3 months ago (2013-09-13 18:55:40 UTC) #6
gab
On 2013/09/13 15:48:36, sukolsak wrote: > On 2013/09/13 15:11:14, gab wrote: > > Why is ...
7 years, 3 months ago (2013-09-13 20:25:05 UTC) #7
sukolsak
On 2013/09/13 20:25:05, gab wrote: > On 2013/09/13 15:48:36, sukolsak wrote: > > On 2013/09/13 ...
7 years, 3 months ago (2013-09-13 21:06:28 UTC) #8
gab
https://codereview.chromium.org/24126005/diff/6001/chrome/test/mini_installer/test_installer.py File chrome/test/mini_installer/test_installer.py (right): https://codereview.chromium.org/24126005/diff/6001/chrome/test/mini_installer/test_installer.py#newcode208 chrome/test/mini_installer/test_installer.py:208: subprocess.call('taskkill /f /im chrome.exe', shell=True) If the intention is ...
7 years, 3 months ago (2013-09-13 21:16:09 UTC) #9
sukolsak
On 2013/09/13 21:16:09, gab wrote: > https://codereview.chromium.org/24126005/diff/6001/chrome/test/mini_installer/test_installer.py > File chrome/test/mini_installer/test_installer.py (right): > > https://codereview.chromium.org/24126005/diff/6001/chrome/test/mini_installer/test_installer.py#newcode208 > ...
7 years, 3 months ago (2013-09-13 21:39:22 UTC) #10
grt (UTC plus 2)
i'm not convinced that killing chromes, setups, etc, at the end of the test is ...
7 years, 3 months ago (2013-09-14 02:30:09 UTC) #11
gab
On 2013/09/14 02:30:09, grt wrote: > i'm not convinced that killing chromes, setups, etc, at ...
7 years, 3 months ago (2013-09-16 14:40:15 UTC) #12
sukolsak
On 2013/09/16 14:40:15, gab wrote: > On 2013/09/14 02:30:09, grt wrote: > > i'm not ...
7 years, 3 months ago (2013-09-19 00:35:14 UTC) #13
gab
https://codereview.chromium.org/24126005/diff/17001/chrome/test/mini_installer/launch_chrome.py File chrome/test/mini_installer/launch_chrome.py (right): https://codereview.chromium.org/24126005/diff/17001/chrome/test/mini_installer/launch_chrome.py#newcode45 chrome/test/mini_installer/launch_chrome.py:45: _, _, process_id, _ = win32process.CreateProcess(None, chrome_path, None, Add ...
7 years, 3 months ago (2013-09-19 18:22:10 UTC) #14
sukolsak
https://codereview.chromium.org/24126005/diff/17001/chrome/test/mini_installer/launch_chrome.py File chrome/test/mini_installer/launch_chrome.py (right): https://codereview.chromium.org/24126005/diff/17001/chrome/test/mini_installer/launch_chrome.py#newcode45 chrome/test/mini_installer/launch_chrome.py:45: _, _, process_id, _ = win32process.CreateProcess(None, chrome_path, None, On ...
7 years, 3 months ago (2013-09-19 20:23:03 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sukolsak@chromium.org/24126005/22001
7 years, 3 months ago (2013-09-19 20:25:00 UTC) #16
commit-bot: I haz the power
7 years, 3 months ago (2013-09-20 00:28:45 UTC) #17
Message was sent while issue was closed.
Change committed as 224256

Powered by Google App Engine
This is Rietveld 408576698