If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Investigate how testBrowserDatabaseHelperUpgrades handles database corruption

NEW
Unassigned

Status

()

Firefox for Android
General
2 years ago
2 years ago

People

(Reporter: mcomella, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
ahunt pointed me at this log [1] from a 2.3 android log that ran testBrowserDatabaseUpgrades:

3-02 10:35:01.635  1003  1011 E Database: CREATE TABLE android_metadata failed
03-02 10:35:01.663  1003  1011 E Database: Failed to setLocale() when constructing, closing the database
03-02 10:35:01.663  1003  1011 E Database: android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed
03-02 10:35:01.663  1003  1011 E Database: 	at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
03-02 10:35:01.663  1003  1011 E Database: 	at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
03-02 10:35:01.663  1003  1011 E Database: 	at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1855)
03-02 10:35:01.663  1003  1011 E Database: 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
03-02 10:35:01.663  1003  1011 E Database: 	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
03-02 10:35:01.663  1003  1011 E Database: 	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
03-02 10:35:01.663  1003  1011 E Database: 	at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:549)
03-02 10:35:01.663  1003  1011 E Database: 	at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)
03-02 10:35:01.663  1003  1011 E Database: 	at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
03-02 10:35:01.663  1003  1011 E Database: 	at org.mozilla.gecko.tests.testBrowserDatabaseHelperUpgrades.test(testBrowserDatabaseHelperUpgrades.java:83)
...
03-02 10:35:01.714  1003  1011 E Database: Deleting and re-creating corrupt database /sdcard/temporaryDB-v27_1910222792db
---

And the test passed. Weird! I'd expect the corruption Exception to throw! We should investigate why this didn't crash (and fail the test). Maybe Android doesn't throw corruption exceptions but just recreates the db?

[1]: http://mozilla-releng-blobs.s3.amazonaws.com/blobs/try/sha512/93a85416f2777229dd4b060df64b4ad8e117bbbf62c3f25bee61f0b88296ecc21b680948cb2a31dcdbe25bbdb8540b274c9aa33fc7ed475e4dedbc185b4a76d7
(Reporter)

Comment 1

2 years ago
try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=88bfd10a6889&filter-searchStr=Android%202.3%20API9%20opt%20Mochitest%20Robocop%20M%28rc4%29&selectedJob=17490873

commit in try: https://hg.mozilla.org/try/rev/7e838975dd49
(Reporter)

Comment 2

2 years ago
Realistically never getting to this.

Another solution here is to fail the tests in automation if we see a "SQLiteDatabaseCorruptException" during tests.
Assignee: michael.l.comella → nobody
You need to log in before you can comment on or make changes to this bug.