diff options
author | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 21:10:21 +0000 |
---|---|---|
committer | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 21:10:21 +0000 |
commit | 2689e2dbe4920f4ff29ef92c02d7511988980df3 (patch) | |
tree | 9f2c000a1ab91477e42f4b68ea5085ed665d8f1e /chrome | |
parent | 920b1c8012d4cc915fb5abd63a095f5bfece3607 (diff) | |
download | chromium_src-2689e2dbe4920f4ff29ef92c02d7511988980df3.zip chromium_src-2689e2dbe4920f4ff29ef92c02d7511988980df3.tar.gz chromium_src-2689e2dbe4920f4ff29ef92c02d7511988980df3.tar.bz2 |
Correcting orphaned process cleanup in out_of_proc_test_runner.cc.
The fix in http://src.chromium.org/viewvc/chrome?view=rev&revision=60192
cleans up orphaned testserver processes only when a test times out and
is killed. However, when a test case crashes and does not trigger a time
out, the clean up doesn't happen.
This patch fixes the clean up logic, and makes sure that testservers are
killed if the test case did not exit cleanly.
BUG=55808
TEST=inject failures in a test suite that uses out_of_proc_test_runner
Review URL: http://codereview.chromium.org/3570004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/test/test_launcher/out_of_proc_test_runner.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/test/test_launcher/out_of_proc_test_runner.cc b/chrome/test/test_launcher/out_of_proc_test_runner.cc index b78f555..d9464f6 100644 --- a/chrome/test/test_launcher/out_of_proc_test_runner.cc +++ b/chrome/test/test_launcher/out_of_proc_test_runner.cc @@ -139,14 +139,17 @@ class OutOfProcTestRunner : public tests::TestRunner { // Ensure that the process terminates. base::KillProcess(process_handle, -1, true); + } #if defined(OS_POSIX) - // On POSIX, we need to clean up any child processes that the test might - // have created. On windows, child processes are automatically cleaned up - // using JobObjects. + if (exit_code != 0) { + // On POSIX, in case the test does not exit cleanly, either due to a crash + // or due to it timing out, we need to clean up any child processes that + // it might have created. On Windows, child processes are automatically + // cleaned up using JobObjects. base::KillProcessGroup(process_handle); -#endif } +#endif return exit_code == 0; } |