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

Issue 11649032: Flush SequenceWorkerPool tasks after each unit test. (Closed)

Created:
8 years ago by michaeln
Modified:
7 years, 9 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, Lei Zhang
Visibility:
Public.

Description

Flush SequenceWorkerPool tasks after each test. Applies to unit_test, interactive_ui test, browser_tests... pretty much all gtest based content library test harnesses are affected. The CL changes semantics and implementation of the existing FlushForTesting method (which wasn't suitable for this usage). * The old method would wait for delayed tasks prior to continuing, the new method will not run them but will delete them prior to continuing. * The old method would deadlock if called after Shutdown had been called, the new method returns immediately in that case. A few SWP unittests relied on the waiting for delayed task completion behavior. Those have been modified to explicitly wait thru other means. BUG=168415, 166470 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=186578

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 2

Patch Set 6 : #

Total comments: 1

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Total comments: 3

Patch Set 13 : #

Patch Set 14 : #

Patch Set 15 : #

Patch Set 16 : #

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Patch Set 20 : #

Patch Set 21 : #

Total comments: 1

Patch Set 22 : #

Patch Set 23 : #

Patch Set 24 : #

Total comments: 11

Patch Set 25 : #

Total comments: 15

Patch Set 26 : #

Patch Set 27 : #

Patch Set 28 : #

Patch Set 29 : #

Patch Set 30 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -43 lines) Patch
M base/test/sequenced_task_runner_test_template.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 10 chunks +15 lines, -2 lines 0 comments Download
M base/test/sequenced_task_runner_test_template.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 chunks +12 lines, -1 line 0 comments Download
M base/test/task_runner_test_template.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 6 chunks +12 lines, -2 lines 0 comments Download
M base/test/task_runner_test_template.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +11 lines, -3 lines 0 comments Download
M base/threading/sequenced_worker_pool.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +1 line, -0 lines 0 comments Download
M base/threading/sequenced_worker_pool.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 16 chunks +95 lines, -19 lines 0 comments Download
M base/threading/sequenced_worker_pool_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 7 chunks +65 lines, -16 lines 0 comments Download
M content/browser/browser_thread_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/browser_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/test/content_test_suite_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 chunks +17 lines, -0 lines 0 comments Download

Messages

Total messages: 59 (0 generated)
michaeln
https://codereview.chromium.org/11649032/diff/7003/base/threading/sequenced_worker_pool.cc File base/threading/sequenced_worker_pool.cc (right): https://codereview.chromium.org/11649032/diff/7003/base/threading/sequenced_worker_pool.cc#newcode640 base/threading/sequenced_worker_pool.cc:640: is_idle_cv_.Signal(); FlushForTesting can wait forever if Shutdown happens after ...
8 years ago (2012-12-21 02:50:47 UTC) #1
michaeln
ptal
8 years ago (2012-12-21 03:02:04 UTC) #2
michaeln
https://codereview.chromium.org/11649032/diff/7003/base/threading/sequenced_worker_pool.cc File base/threading/sequenced_worker_pool.cc (right): https://codereview.chromium.org/11649032/diff/7003/base/threading/sequenced_worker_pool.cc#newcode392 base/threading/sequenced_worker_pool.cc:392: // FlushForTesting()) until IsIdle() goes to true or Shutdown ...
8 years ago (2012-12-21 03:17:54 UTC) #3
michaeln
trybots seem to like it!
8 years ago (2012-12-21 04:23:01 UTC) #4
michaeln
removed some suppressions and running thru the bots again
8 years ago (2012-12-21 22:15:54 UTC) #5
not at google - send to devlin
Btw leaving this one for akalin now since it's not really extension related anymore, and ...
8 years ago (2012-12-21 22:17:13 UTC) #6
michaeln
also cc'ing thestig who's been adding suppressions that look quite related to this
8 years ago (2012-12-21 22:20:18 UTC) #7
michaeln
https://codereview.chromium.org/11649032/diff/23001/base/threading/sequenced_worker_pool.cc File base/threading/sequenced_worker_pool.cc (right): https://codereview.chromium.org/11649032/diff/23001/base/threading/sequenced_worker_pool.cc#newcode631 base/threading/sequenced_worker_pool.cc:631: shutdown_called_ = true; Hi Fred, Not sure if you've ...
8 years ago (2012-12-21 23:43:19 UTC) #8
michaeln
Drat, the latest tryrun still showing a problem in memory test: unit on linux_valgrind when ...
8 years ago (2012-12-22 00:34:00 UTC) #9
michaeln
I'm starting to wonder if FlushForTesting() actually accomplishes that in all case? Ikd, maybe somewhere ...
8 years ago (2012-12-22 02:21:18 UTC) #10
michaeln
Hi Fred, Use of SWP for dom storage has led me down this trail... * ...
7 years, 12 months ago (2012-12-28 01:36:02 UTC) #11
akalin
On 2012/12/28 01:36:02, michaeln wrote: > Hi Fred, > > Use of SWP for dom ...
7 years, 12 months ago (2012-12-28 09:50:18 UTC) #12
akalin
On 2012/12/28 09:50:18, akalin wrote: > Ah, I didn't think of this. Yeah, I'm okay ...
7 years, 12 months ago (2012-12-28 09:57:04 UTC) #13
michaeln
> On 2012/12/28 01:36:02, michaeln wrote: > > Hi Fred, > > > > Use ...
7 years, 11 months ago (2013-01-02 22:11:03 UTC) #14
michaeln
> Maybe we could shutdown and destroy the SWP between each test fixture? I think ...
7 years, 11 months ago (2013-01-02 22:30:07 UTC) #15
akalin
On 2013/01/02 22:11:03, michaeln wrote: > > On 2012/12/28 01:36:02, michaeln wrote: > > > ...
7 years, 11 months ago (2013-01-04 01:19:21 UTC) #16
akalin
On 2013/01/02 22:30:07, michaeln wrote: > > Maybe we could shutdown and destroy the SWP ...
7 years, 11 months ago (2013-01-04 01:20:01 UTC) #17
michaeln
> Yeah, it looks like I came to the same conclusion in my reply to ...
7 years, 11 months ago (2013-01-04 20:19:26 UTC) #18
michaeln
I've filed a separate bug about the SWP task cleanup specifically. https://code.google.com/p/chromium/issues/detail?id=168415
7 years, 11 months ago (2013-01-04 22:31:28 UTC) #19
michaeln
Trybots somewhat consistetly complaining about the same set of tests on linux, win, and mac ...
7 years, 11 months ago (2013-01-10 22:17:38 UTC) #20
michaeln
some low hanging... fruit CleanupForTesting() should return immediately if no tasks have ever been posted
7 years, 11 months ago (2013-01-10 22:46:46 UTC) #21
michaeln
Ahh... snapshot 10 is looking not bad!
7 years, 11 months ago (2013-01-10 23:25:30 UTC) #22
michaeln
> Ahh... snapshot 10 is looking not bad! Overwhelmingly, tests are running as expected, and ...
7 years, 11 months ago (2013-01-11 00:18:13 UTC) #23
michaeln
I'm ignoring the SLHostStateTest leaks (see crbug/82974) but am taking a closer look at the ...
7 years, 11 months ago (2013-01-14 23:56:10 UTC) #24
michaeln
Hi Jim, here's the CL i was talking about.
7 years, 11 months ago (2013-01-15 02:11:49 UTC) #25
jar (doing other things)
I just skimmed this (wasn't sure if you were proposing this as final). https://codereview.chromium.org/11649032/diff/88001/base/test/task_runner_test_template.h File ...
7 years, 11 months ago (2013-01-15 22:59:59 UTC) #26
michaeln
Thnx for looking. > I just skimmed this (wasn't sure if you were proposing this ...
7 years, 11 months ago (2013-01-15 23:16:08 UTC) #27
michaeln
> Not quite yet, I'm stilling looking into the PageCycler test failure. Its > forcing ...
7 years, 11 months ago (2013-01-16 01:03:30 UTC) #28
michaeln
Idk wassup with the page cycler test I'm trying a snapshot w/o my changes to ...
7 years, 11 months ago (2013-01-18 21:20:03 UTC) #29
michaeln
Test passed when reverting. Still don't get it but reduced the problem a little. The ...
7 years, 11 months ago (2013-01-19 00:42:21 UTC) #30
michaeln
ah... maybe something to go on form this sea of red that happened to get ...
7 years, 11 months ago (2013-01-19 02:21:01 UTC) #31
michaeln
Found bugs and fixed them, ptal. https://codereview.chromium.org/11649032/diff/135033/base/threading/sequenced_worker_pool.cc File base/threading/sequenced_worker_pool.cc (right): https://codereview.chromium.org/11649032/diff/135033/base/threading/sequenced_worker_pool.cc#newcode794 base/threading/sequenced_worker_pool.cc:794: void SequencedWorkerPool::Inner::HandleCleanup() { ...
7 years, 11 months ago (2013-01-23 00:16:07 UTC) #32
michaeln
Also keep in mind that in production code cleanup_state_ is always DONE.
7 years, 11 months ago (2013-01-23 00:22:19 UTC) #33
michaeln
Looks like this new function is functioning as intended and existing tests pass with this ...
7 years, 11 months ago (2013-01-25 21:40:44 UTC) #34
michaeln
ping... I've removed the removal of the memcheck suppressions from this CL.
7 years, 10 months ago (2013-01-28 20:31:43 UTC) #35
jar (doing other things)
"Best practice" is to include the name(s) of the target of your pings. T'was it ...
7 years, 10 months ago (2013-01-28 20:45:14 UTC) #36
michaeln
ok... ping jar
7 years, 10 months ago (2013-01-28 20:58:26 UTC) #37
michaeln
ping, @jar @akalin @somebody :)
7 years, 10 months ago (2013-01-31 21:42:41 UTC) #38
michaeln
hey guys, this CL is going to bit rot unless you take a look. i ...
7 years, 10 months ago (2013-02-12 02:03:51 UTC) #39
jar (doing other things)
I apologize for my lack of responsiveness. I keep getting pulled every which way. I'll ...
7 years, 10 months ago (2013-02-12 02:26:01 UTC) #40
michaeln
patch is still in my local copy, but if/when i get a merge conflict i'll ...
7 years, 10 months ago (2013-02-21 22:16:27 UTC) #41
jar (doing other things)
akalin: Can you answer the one question for you listed below? Assuming a good answer, ...
7 years, 10 months ago (2013-02-22 23:39:47 UTC) #42
michaeln
thnx! https://codereview.chromium.org/11649032/diff/145001/base/test/sequenced_task_runner_test_template.cc File base/test/sequenced_task_runner_test_template.cc (right): https://codereview.chromium.org/11649032/diff/145001/base/test/sequenced_task_runner_test_template.cc#newcode98 base/test/sequenced_task_runner_test_template.cc:98: while (task_end_count_ != count) On 2013/02/22 23:39:47, jar ...
7 years, 10 months ago (2013-02-23 01:10:16 UTC) #43
michaeln
https://codereview.chromium.org/11649032/diff/145001/base/test/task_runner_test_template.cc File base/test/task_runner_test_template.cc (right): https://codereview.chromium.org/11649032/diff/145001/base/test/task_runner_test_template.cc#newcode24 base/test/task_runner_test_template.cc:24: ++task_run_counts_[i]; On 2013/02/22 23:39:47, jar wrote: > aklin: Why ...
7 years, 10 months ago (2013-02-23 02:38:46 UTC) #44
michaeln
> aklin: Why do we increment count, when we *don't* run?? > Assuming a good ...
7 years, 10 months ago (2013-02-25 21:40:21 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/michaeln@chromium.org/11649032/163001
7 years, 10 months ago (2013-02-25 21:41:12 UTC) #46
commit-bot: I haz the power
Presubmit check for 11649032-163001 failed and returned exit status 1. INFO:root:Found 10 file(s). Running presubmit ...
7 years, 10 months ago (2013-02-25 21:41:19 UTC) #47
michaeln
+sky for OWNERS Missing LGTM from an OWNER for these files: content/browser/browser_thread_impl.h content/public/test/content_test_suite_base.cc content/browser/browser_thread_impl.cc
7 years, 10 months ago (2013-02-25 22:01:49 UTC) #48
sky
I'm not a fan of the ForTesting style. I prefer a friend class. I'm leaving ...
7 years, 10 months ago (2013-02-25 22:59:55 UTC) #49
michaeln
Modulo stylisms wdyt? I half expect John to defer to you on the testing infrastructure ...
7 years, 10 months ago (2013-02-25 23:37:31 UTC) #50
akalin
lgtm after nits (I tried not to bikeshed this too much.) https://codereview.chromium.org/11649032/diff/145001/base/test/task_runner_test_template.cc File base/test/task_runner_test_template.cc (right): ...
7 years, 10 months ago (2013-02-26 00:12:22 UTC) #51
michaeln
https://codereview.chromium.org/11649032/diff/163001/base/threading/sequenced_worker_pool.cc File base/threading/sequenced_worker_pool.cc (right): https://codereview.chromium.org/11649032/diff/163001/base/threading/sequenced_worker_pool.cc#newcode802 base/threading/sequenced_worker_pool.cc:802: if (cleanup_state_ == CLEANUP_REQUESTED) { On 2013/02/26 00:12:23, akalin ...
7 years, 10 months ago (2013-02-26 00:33:00 UTC) #52
jam
On 2013/02/25 22:59:55, sky wrote: > I'm not a fan of the ForTesting style. I ...
7 years, 10 months ago (2013-02-26 02:22:41 UTC) #53
sky
On Mon, Feb 25, 2013 at 6:22 PM, <jam@chromium.org> wrote: > On 2013/02/25 22:59:55, sky ...
7 years, 10 months ago (2013-02-26 03:24:42 UTC) #54
michaeln
> Not necessarily. Could still expose a private method that does this. I'll upload a ...
7 years, 10 months ago (2013-02-26 20:37:59 UTC) #55
michaeln
ptal... friendified the ForTesting method and... https://codereview.chromium.org/11649032/diff/163001/base/test/sequenced_task_runner_test_template.h File base/test/sequenced_task_runner_test_template.h (right): https://codereview.chromium.org/11649032/diff/163001/base/test/sequenced_task_runner_test_template.h#newcode65 base/test/sequenced_task_runner_test_template.h:65: void WaitForCountTasksToComplete(int count); ...
7 years, 10 months ago (2013-02-27 00:57:11 UTC) #56
michaeln
@sky or jam, ping for OWNERS
7 years, 9 months ago (2013-02-27 22:52:12 UTC) #57
michaeln
ok... ping, with a difference... committing on monday unless somebody articulates good reason not to
7 years, 9 months ago (2013-03-01 22:03:36 UTC) #58
michaeln
7 years, 9 months ago (2013-03-07 01:35:41 UTC) #59
Message was sent while issue was closed.
Committed patchset #30 manually as r186578.

Powered by Google App Engine
This is Rietveld 408576698