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

Issue 372057: Isolate tests by running AtExit callbacks between them. (Closed)

Created:
11 years, 1 month ago by Paweł Hajdan Jr.
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Isolate tests by running AtExit callbacks between them. For now, this is only for base_unittests. The plan is to enable it for all unit tests. This should finally fix mysterious problems cause by Singletons surviving after one test etc. This change also adapts LazyInstance so that it can be reused after being destroyed. It is used very frequently, for example each time a MessageLoop is used. It is also worth noting that we had some problems in the past related to the MessageLoop being destroyed and re-instantiated in the same test executable. This patch should also fix that. TEST=none BUG=12710 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=32507

Patch Set 1 #

Total comments: 9

Patch Set 2 : update #

Total comments: 3

Patch Set 3 : update #

Patch Set 4 : fix Linux hang #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -31 lines) Patch
M base/at_exit.h View 1 1 chunk +7 lines, -0 lines 0 comments Download
M base/at_exit_unittest.cc View 4 chunks +9 lines, -15 lines 0 comments Download
M base/lazy_instance.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M base/lazy_instance.cc View 2 chunks +13 lines, -1 line 0 comments Download
M base/lazy_instance_unittest.cc View 3 chunks +2 lines, -7 lines 0 comments Download
M base/singleton_unittest.cc View 3 chunks +2 lines, -7 lines 0 comments Download
M base/test/run_all_unittests.cc View 1 chunk +3 lines, -1 line 0 comments Download
M base/test/test_suite.h View 1 2 3 4 chunks +36 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Paweł Hajdan Jr.
11 years, 1 month ago (2009-11-09 14:55:58 UTC) #1
sky
I'm not too familiar with these classes. I'm going to let Brett and Huan handle ...
11 years, 1 month ago (2009-11-09 17:45:31 UTC) #2
brettw
I've never touched this code either. The changelog says cpu and mentovai are the main ...
11 years, 1 month ago (2009-11-09 21:03:33 UTC) #3
cpu_(ooo_6.6-7.5)
I can review later today. I think this is a good idea, but I've yet ...
11 years, 1 month ago (2009-11-09 22:12:47 UTC) #4
Paweł Hajdan Jr.
+M-A
11 years, 1 month ago (2009-11-10 22:25:47 UTC) #5
Paweł Hajdan Jr.
+M-A http://codereview.chromium.org/372057
11 years, 1 month ago (2009-11-10 22:26:06 UTC) #6
cpu_(ooo_6.6-7.5)
Some questions below. Also I think you should do a test of this shadowing thing, ...
11 years, 1 month ago (2009-11-10 23:08:30 UTC) #7
cpu_(ooo_6.6-7.5)
Some questions below. Also I think you should do a test of this shadowing thing, ...
11 years, 1 month ago (2009-11-10 23:08:47 UTC) #8
M-A Ruel
Actually, Mike wrote LazyInstance. http://codereview.chromium.org/372057/diff/1/3 File base/at_exit.h (right): http://codereview.chromium.org/372057/diff/1/3#newcode12 Line 12: #include "base/logging.h" much sadness. ...
11 years, 1 month ago (2009-11-10 23:43:14 UTC) #9
M-A Ruel
Actually, Mike wrote LazyInstance. http://codereview.chromium.org/372057/diff/1/3 File base/at_exit.h (right): http://codereview.chromium.org/372057/diff/1/3#newcode12 Line 12: #include "base/logging.h" much sadness. ...
11 years, 1 month ago (2009-11-10 23:43:42 UTC) #10
Paweł Hajdan Jr.
Patch updated, that should address most comments. Some answers below. On 2009/11/10 23:08:47, cpu wrote: ...
11 years, 1 month ago (2009-11-11 11:25:07 UTC) #11
Paweł Hajdan Jr.
Patch updated, that should address most comments. Some answers below. On 2009/11/10 23:08:47, cpu wrote: ...
11 years, 1 month ago (2009-11-11 11:25:30 UTC) #12
Paweł Hajdan Jr.
ping!
11 years, 1 month ago (2009-11-12 15:49:37 UTC) #13
M-A Ruel
http://codereview.chromium.org/372057/diff/5003/5007 File base/lazy_instance.h (right): http://codereview.chromium.org/372057/diff/5003/5007#newcode79 Line 79: static void ResetState(void* helper); Can you add a ...
11 years, 1 month ago (2009-11-12 15:59:11 UTC) #14
Paweł Hajdan Jr.
On 2009/11/12 15:59:11, Marc-Antoine Ruel wrote: > http://codereview.chromium.org/372057/diff/5003/5007 > File base/lazy_instance.h (right): > > http://codereview.chromium.org/372057/diff/5003/5007#newcode79 ...
11 years, 1 month ago (2009-11-12 17:05:26 UTC) #15
M-A Ruel
lgtm but make sure it passes the try jobs.
11 years, 1 month ago (2009-11-12 17:12:20 UTC) #16
M-A Ruel
On 2009/11/12 17:12:20, Marc-Antoine Ruel wrote: > lgtm but make sure it passes the try ...
11 years, 1 month ago (2009-11-12 18:35:10 UTC) #17
Paweł Hajdan Jr.
Will investigate that on Linux before landing, don't worry. :) One of the reasons I ...
11 years, 1 month ago (2009-11-12 18:37:53 UTC) #18
cpu_(ooo_6.6-7.5)
lgtm
11 years, 1 month ago (2009-11-12 21:04:08 UTC) #19
Paweł Hajdan Jr.
This new version fixes a hang on Linux. The NSPR cleanup (when ran between tests) ...
11 years, 1 month ago (2009-11-16 09:53:27 UTC) #20
M-A Ruel
11 years, 1 month ago (2009-11-16 17:25:13 UTC) #21
lgtm but the NSS stuff bothers me. :(

Powered by Google App Engine
This is Rietveld 408576698