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

Issue 2344001: Restricting lifetime of python sync server on Windows via a JobObject. (Closed)

Created:
10 years, 7 months ago by Raghu Simha
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Restricting lifetime of python sync server on Windows via a JobObject. If a sync integration test runs for 30 seconds or more, OutOfProcTestRunner forcibly kills the test case executable. This leaves an orphaned python server instance in memory. When a subsequent test case is run, it attempts to kick off a new python server and immediately checks for the existence of a running server, following which it pumps messages to the server instance. If the server detected by the test case happens to be the old orphaned instance (that goes on to die when a new server instance is started), test cases can fail. This change list restricts the lifetime of the python.exe process started by a test case such that if the test case is killed by OutOfProcTestRunner, the python server instance it created dies with it. In order to restrict the lifetime of a test server, it needs to be started as a job. When a test server is spawned as a child process by a test case that is running under a debugger, the child process needs to be created using the CREATE_BREAKAWAY_FROM_JOB flag to first disassociate it from the JobObject created by the debugger. TestServerLauncher::Start() used to invoke base::LaunchApp() in order to create the child process. This changelist implements a new method in class TestServerLauncher called LaunchTestServerAsJob(). The call to base::LaunchApp() in TestServerLauncher::Start() is replaced with a call to TestServerLauncher::LaunchTestServerAsJob(). BUG=43777 TEST=sync_integration_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=48762

Patch Set 1 #

Patch Set 2 : Setting core.autocrlf to false to eliminate ^M after every line. #

Patch Set 3 : Removing existing ^M characters in ssl_test_util.cc. #

Patch Set 4 : Adding LaunchTestServerAsJob method to class TestServerLauncher. #

Total comments: 8

Patch Set 5 : Making LaunchTestServerAsJob a helper method; misc. fixes. #

Total comments: 2

Patch Set 6 : Fixing small nit (adding end-of-namespace comment). #

Patch Set 7 : Adding a missing "#if defined" (for job_handle_ member). #

Patch Set 8 : Cleaning up more ^Ms I found in the file. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -4 lines) Patch
M net/socket/ssl_test_util.h View 4 5 6 7 4 chunks +21 lines, -2 lines 0 comments Download
M net/socket/ssl_test_util.cc View 1 2 3 4 3 chunks +60 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Raghu Simha
This is the starting point of this checkin. The "access denied" error message that appears ...
10 years, 7 months ago (2010-05-28 00:13:16 UTC) #1
Raghu Simha
10 years, 7 months ago (2010-05-28 00:19:51 UTC) #2
Raghu Simha
10 years, 7 months ago (2010-05-28 00:49:07 UTC) #3
Raghu Simha
Patch set 4 addresses the ACCESS_DENIED errors that were seen when the code was run ...
10 years, 7 months ago (2010-05-28 04:53:38 UTC) #4
Raghu Simha
10 years, 7 months ago (2010-05-28 04:54:12 UTC) #5
ncarter (slow)
http://codereview.chromium.org/2344001/diff/11001/12001 File net/socket/ssl_test_util.cc (right): http://codereview.chromium.org/2344001/diff/11001/12001#newcode356 net/socket/ssl_test_util.cc:356: bool TestServerLauncher::LaunchTestServerAsJob(const std::wstring& cmdline, Better to make this a ...
10 years, 7 months ago (2010-05-28 18:01:48 UTC) #6
M-A Ruel
It'd be nice if you could reuse code, like src/sandbox/src/job.h but I don't mind too ...
10 years, 7 months ago (2010-05-28 19:21:43 UTC) #7
Raghu Simha
On 2010/05/28 19:21:43, Marc-Antoine Ruel wrote: > It'd be nice if you could reuse code, ...
10 years, 6 months ago (2010-05-28 22:39:44 UTC) #8
Raghu Simha
10 years, 6 months ago (2010-05-29 19:25:02 UTC) #9
M-A Ruel
You still haven't done Nick's comments which are relevant. Other than that lgtm.
10 years, 6 months ago (2010-05-31 14:46:04 UTC) #10
Raghu Simha
On 2010/05/31 14:46:04, Marc-Antoine Ruel wrote: > You still haven't done Nick's comments which are ...
10 years, 6 months ago (2010-06-02 01:32:22 UTC) #11
Raghu Simha
http://codereview.chromium.org/2344001/diff/11001/12001 File net/socket/ssl_test_util.cc (right): http://codereview.chromium.org/2344001/diff/11001/12001#newcode356 net/socket/ssl_test_util.cc:356: bool TestServerLauncher::LaunchTestServerAsJob(const std::wstring& cmdline, On 2010/05/28 18:01:48, nick wrote: ...
10 years, 6 months ago (2010-06-02 01:32:33 UTC) #12
M-A Ruel
lgtm with a small nit http://codereview.chromium.org/2344001/diff/21001/22002 File net/socket/ssl_test_util.h (right): http://codereview.chromium.org/2344001/diff/21001/22002#newcode143 net/socket/ssl_test_util.h:143: } } // namespace ...
10 years, 6 months ago (2010-06-02 01:42:13 UTC) #13
Raghu Simha
Done fixing small nit. Thanks :) http://codereview.chromium.org/2344001/diff/21001/22002 File net/socket/ssl_test_util.h (right): http://codereview.chromium.org/2344001/diff/21001/22002#newcode143 net/socket/ssl_test_util.h:143: } On 2010/06/02 ...
10 years, 6 months ago (2010-06-02 01:48:32 UTC) #14
ncarter (slow)
10 years, 6 months ago (2010-06-02 18:42:03 UTC) #15
On 2010/06/02 01:48:32, rsimha wrote:
> Done fixing small nit. Thanks :)
> 
> http://codereview.chromium.org/2344001/diff/21001/22002
> File net/socket/ssl_test_util.h (right):
> 
> http://codereview.chromium.org/2344001/diff/21001/22002#newcode143
> net/socket/ssl_test_util.h:143: }
> On 2010/06/02 01:42:13, Marc-Antoine Ruel wrote:
> > }  // namespace net
> 
> Done.

LGTM

Powered by Google App Engine
This is Rietveld 408576698