Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Issue 16664005: [sql] Framework for allowing tests to handle errors. (Closed)

Created:
7 years, 6 months ago by Scott Hess - ex-Googler
Modified:
7 years, 6 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

[sql] Framework for allowing tests to handle errors. sql/ throws FATAL whenever it sees inappropriate calls, which makes production code to handle errors hard to test. ScopedErrorIgnorer provides a way for tests to signal that specific errors are expected and will be handled. As a first pass, code up some additional tests for some Raze() edge cases, and modify things to pass those tests. BUG=159490 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=207096

Patch Set 1 #

Patch Set 2 : tie-poh #

Patch Set 3 : Call ShouldIgnoreError() in all modes. #

Total comments: 8

Patch Set 4 : Refactor along lines of comment #4. #

Total comments: 30

Patch Set 5 : Erik's comments, plus lazy instance for global. #

Total comments: 9

Patch Set 6 : Convert to using a callback pointer to get rid of lazy instance. #

Patch Set 7 : Erik's suggested gyp changes. #

Total comments: 2

Patch Set 8 : final gyp cleanup. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -12 lines) Patch
M sql/connection.h View 1 2 3 4 5 6 7 2 chunks +11 lines, -0 lines 0 comments Download
M sql/connection.cc View 1 2 3 4 5 6 7 5 chunks +32 lines, -12 lines 0 comments Download
M sql/connection_unittest.cc View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M sql/sql.gyp View 1 2 3 4 5 6 7 2 chunks +37 lines, -0 lines 0 comments Download
A sql/test/scoped_error_ignorer.h View 1 2 3 4 5 1 chunk +64 lines, -0 lines 0 comments Download
A sql/test/scoped_error_ignorer.cc View 1 2 3 4 5 1 chunk +60 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
Scott Hess - ex-Googler
Found an old CL on a random laptop and cleaned it up...
7 years, 6 months ago (2013-06-07 22:33:15 UTC) #1
Scott Hess - ex-Googler
The recent chance was necessary because otherwise the tests failed in release mode because in ...
7 years, 6 months ago (2013-06-10 21:40:20 UTC) #2
erikwright (departed)
https://codereview.chromium.org/16664005/diff/13001/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/16664005/diff/13001/sql/connection.cc#newcode338 sql/connection.cc:338: // SQLITE_NOTADB can happen if page 1 exists but ...
7 years, 6 months ago (2013-06-11 18:54:19 UTC) #3
Scott Hess - ex-Googler
No new changes up, but please consider my echo of what I think you asked ...
7 years, 6 months ago (2013-06-12 22:42:46 UTC) #4
Scott Hess - ex-Googler
OK, new changes along the lines of comment #4. I also tried a version using ...
7 years, 6 months ago (2013-06-13 00:22:08 UTC) #5
Scott Hess - ex-Googler
On 2013/06/13 00:22:08, shess wrote: > I also tried a version using an abstract base ...
7 years, 6 months ago (2013-06-13 00:26:17 UTC) #6
erikwright (departed)
https://codereview.chromium.org/16664005/diff/23001/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/16664005/diff/23001/sql/connection.cc#newcode464 sql/connection.cc:464: // in production if the schema is corrupted. Fix ...
7 years, 6 months ago (2013-06-13 01:26:24 UTC) #7
erikwright (departed)
https://codereview.chromium.org/16664005/diff/23001/sql/test/scoped_error_ignorer.h File sql/test/scoped_error_ignorer.h (right): https://codereview.chromium.org/16664005/diff/23001/sql/test/scoped_error_ignorer.h#newcode38 sql/test/scoped_error_ignorer.h:38: // TODO(shess): How to handle ASSERT_X() cases which cause ...
7 years, 6 months ago (2013-06-13 01:27:57 UTC) #8
Scott Hess - ex-Googler
Thank you for the useful comments, this is feeling stronger to me. I also prototyped ...
7 years, 6 months ago (2013-06-13 03:23:27 UTC) #9
Scott Hess - ex-Googler
OK. I tried the version with the callback owned by the scoper, and the global ...
7 years, 6 months ago (2013-06-13 20:41:03 UTC) #10
erikwright (departed)
LG. I'll verify your final gyp changes. https://chromiumcodereview.appspot.com/16664005/diff/39001/sql/sql.gyp File sql/sql.gyp (right): https://chromiumcodereview.appspot.com/16664005/diff/39001/sql/sql.gyp#newcode40 sql/sql.gyp:40: '../base/base.gyp:test_support_base', On ...
7 years, 6 months ago (2013-06-13 22:58:06 UTC) #11
Scott Hess - ex-Googler
Added your suggestions, with some interpretation. I think. I did go out and use this ...
7 years, 6 months ago (2013-06-13 23:58:38 UTC) #12
erikwright (departed)
LGTM. https://chromiumcodereview.appspot.com/16664005/diff/39001/sql/sql.gyp File sql/sql.gyp (right): https://chromiumcodereview.appspot.com/16664005/diff/39001/sql/sql.gyp#newcode40 sql/sql.gyp:40: '../base/base.gyp:test_support_base', On 2013/06/13 23:58:39, shess wrote: > On ...
7 years, 6 months ago (2013-06-17 17:42:29 UTC) #13
Scott Hess - ex-Googler
OK. I think I'm almost understanding things, more's the pity. * 'dependencies' - IWYU * ...
7 years, 6 months ago (2013-06-17 20:54:59 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/16664005/69001
7 years, 6 months ago (2013-06-17 20:55:44 UTC) #15
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=164815
7 years, 6 months ago (2013-06-18 05:35:36 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/16664005/69001
7 years, 6 months ago (2013-06-18 18:29:14 UTC) #17
commit-bot: I haz the power
7 years, 6 months ago (2013-06-18 22:18:12 UTC) #18
Message was sent while issue was closed.
Change committed as 207096

Powered by Google App Engine
This is Rietveld 408576698