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

Issue 22799005: Flush the blocking pool in TestBrowserThreadBundle. (Closed)

Created:
7 years, 4 months ago by earthdok
Modified:
7 years, 4 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

Flush the blocking pool in TestBrowserThreadBundle. While we already flush the blocking pool in a OnTestEnd() hook (installed in ContentTestSuiteBase), that is too late for tests that create their own threads. The test (and the TestBrowserThreadBundle that it contains) will have been destroyed by the time the hook runs, and any tasks posted to the blocking pool via PostTaskAndReply will not be able to reply back to the originating thread. This causes the task and reply Closures to be leaked. Flushing the blocking pool before TestBrowserThreadBundle is destroyed should fix those leaks. BUG=168415, 270673, 270658 TBR=ajwong@chromium.org, jochen@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=217268

Patch Set 1 #

Patch Set 2 : flush the message loop one extra time #

Total comments: 3

Patch Set 3 : flush the pool also at the point where it's normally shut down #

Patch Set 4 : added documentation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -0 lines) Patch
M content/browser/browser_thread_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/test_browser_thread_bundle.h View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/test/test_browser_thread_bundle.cc View 1 2 3 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
earthdok
please take a look sky for content/browser/ jochen for content/public/test/
7 years, 4 months ago (2013-08-12 15:06:16 UTC) #1
awong
https://codereview.chromium.org/22799005/diff/4001/content/public/test/test_browser_thread_bundle.cc File content/public/test/test_browser_thread_bundle.cc (right): https://codereview.chromium.org/22799005/diff/4001/content/public/test/test_browser_thread_bundle.cc#newcode27 content/public/test/test_browser_thread_bundle.cc:27: BrowserThreadImpl::FlushThreadPoolHelper(); I'm thinking this should be done after db_thread_ ...
7 years, 4 months ago (2013-08-12 18:45:53 UTC) #2
earthdok
https://codereview.chromium.org/22799005/diff/4001/content/public/test/test_browser_thread_bundle.cc File content/public/test/test_browser_thread_bundle.cc (right): https://codereview.chromium.org/22799005/diff/4001/content/public/test/test_browser_thread_bundle.cc#newcode27 content/public/test/test_browser_thread_bundle.cc:27: BrowserThreadImpl::FlushThreadPoolHelper(); On 2013/08/12 18:45:53, awong wrote: > I'm thinking ...
7 years, 4 months ago (2013-08-12 19:18:31 UTC) #3
jochen (gone - plz use gerrit)
i don't really know about this code. Albert seems to have some clue, so I'm ...
7 years, 4 months ago (2013-08-12 19:23:31 UTC) #4
earthdok
Updated as per Albert's suggestion.
7 years, 4 months ago (2013-08-12 19:25:37 UTC) #5
awong
https://codereview.chromium.org/22799005/diff/4001/content/public/test/test_browser_thread_bundle.cc File content/public/test/test_browser_thread_bundle.cc (right): https://codereview.chromium.org/22799005/diff/4001/content/public/test/test_browser_thread_bundle.cc#newcode27 content/public/test/test_browser_thread_bundle.cc:27: BrowserThreadImpl::FlushThreadPoolHelper(); On 2013/08/12 19:18:31, earthdok wrote: > On 2013/08/12 ...
7 years, 4 months ago (2013-08-12 19:29:10 UTC) #6
earthdok
On 2013/08/12 19:29:10, awong wrote: > The class comment in the header file is where ...
7 years, 4 months ago (2013-08-12 19:53:40 UTC) #7
awong
LGTM
7 years, 4 months ago (2013-08-12 21:05:44 UTC) #8
earthdok
Jochen, please approve.
7 years, 4 months ago (2013-08-13 08:48:26 UTC) #9
jochen (gone - plz use gerrit)
lgtm
7 years, 4 months ago (2013-08-13 09:06:10 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/earthdok@chromium.org/22799005/15001
7 years, 4 months ago (2013-08-13 10:30:52 UTC) #11
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) telemetry_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=159252
7 years, 4 months ago (2013-08-13 11:46:24 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/earthdok@chromium.org/22799005/15001
7 years, 4 months ago (2013-08-13 12:00:23 UTC) #13
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) telemetry_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=159287
7 years, 4 months ago (2013-08-13 12:56:15 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/earthdok@chromium.org/22799005/15001
7 years, 4 months ago (2013-08-13 15:32:29 UTC) #15
earthdok
7 years, 4 months ago (2013-08-13 16:10:13 UTC) #16
Message was sent while issue was closed.
Committed patchset #4 manually as r217268 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698