DescriptionRestricting 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. #Messages
Total messages: 15 (0 generated)
|