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

Issue 128993004: Fix subtle bug with the in-process utility thread usage in unit tests. (Closed)

Created:
6 years, 11 months ago by jam
Modified:
6 years, 11 months ago
Reviewers:
scottmg
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, James Cook
Visibility:
Public.

Description

Fix subtle bug with the in-process utility thread usage in unit tests. Recently this started flaking. The problem was that the exit manager (or the shadowing one if it was there) would run before the in-process utility thread shutdown. Since the thread was holding on to g_one_utility_thread_lock, the exit manager would try to destroy that LazyInstance but it would fail because the lock was still owned by a different thread. The fix is to ensure that the utility thread is gone. This is done by waiting for all UtilityProcessHost objects to get destructed. This wasn't happening before because the tests would just wait for their app-specific IPC from the utility thread, which is dispatched before the OnChannelError in ChildProcessHost ends up killing the UtilityProcessHost. BUG=316919 R=scottmg@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=243793

Patch Set 1 #

Patch Set 2 : fix clang #

Patch Set 3 : sync #

Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -15 lines) Patch
M chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc View 1 2 3 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_service_unittest.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service_unittest.cc View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/extensions/sandboxed_unpacker_unittest.cc View 1 2 4 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/extensions/updater/extension_updater_unittest.cc View 1 2 4 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/safe_browsing/download_protection_service_unittest.cc View 1 2 4 chunks +2 lines, -3 lines 0 comments Download
M content/public/test/test_utils.h View 1 2 2 chunks +29 lines, -0 lines 0 comments Download
M content/public/test/test_utils.cc View 1 2 2 chunks +34 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
jam
6 years, 11 months ago (2014-01-08 22:39:31 UTC) #1
scottmg
On 2014/01/08 22:39:31, jam wrote: lgtm Are any of these others potentially affected? https://code.google.com/p/chromium/codesearch#search/&q=SetRunRendererInProcess&sq=package:chromium&type=cs chrome/browser/plugins/plugin_prefs_unittest.cc ...
6 years, 11 months ago (2014-01-08 22:46:38 UTC) #2
jam
6 years, 11 months ago (2014-01-08 22:53:13 UTC) #3
On 2014/01/08 22:46:38, scottmg wrote:
> On 2014/01/08 22:39:31, jam wrote:
> 
> lgtm
> 
> Are any of these others potentially affected? 
>
https://code.google.com/p/chromium/codesearch#search/&q=SetRunRendererInProce...
> 
> chrome/browser/plugins/plugin_prefs_unittest.cc
> chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc

no, these were using that flag for Linux plugin loading to happen on the IO
thread. That doesn't use the in-process utility-thread.

Powered by Google App Engine
This is Rietveld 408576698