DescriptionModify sync unit test to use standard sql::test:: helper.
Sync tests for DirectoryBackingStore overwrote/truncated the underlying
database file, which SQLite did not notice because of exclusive locking
and the page cache. So then the tests accessed a lot of data to defeat
that. This is brittle in the face of various changes to how
sql::Connection sets up the underlying sqlite3 handle.
Add sql::test::CorruptSizeInHeaderWithLock() to allow corrupting the
database while SQLite connections are outstanding. Remove
set_exclusive_locking() for DirectoryBackingStore to allow
CorruptSizeInHeaderWithLock() to run.
Removing set_exclusive_locking() should not cause notable performance
degradation. SQLite keeps a cookie in the header page to track database
changes, which allows it to re-used cache pages. So there will be
uncontended locking (because nobody else locks the file), and the header
read should be from warm filesystem cache.
BUG=533682
Committed: https://crrev.com/4640cc232029f854e84455d2087ca071a3870ee6
Cr-Commit-Position: refs/heads/master@{#426316}
Patch Set 1 #Patch Set 2 : Add on changes for sync_integration_tests. #Patch Set 3 : BUILD.gn merge #
Messages
Total messages: 26 (15 generated)
|