Closed Bug 735856 Opened 12 years ago Closed 12 years ago

Opt robocop failure after upgrading to SUT Agent 1.07 upgrade (testWebContentContextMenu | Bookmark removal verified - got false, expected true)

Categories

(Testing :: Talos, defect)

x86
macOS
defect
Not set
normal

Tracking

(firefox12-, firefox13 fixed, firefox14 fixed)

RESOLVED FIXED
mozilla14
Tracking Status
firefox12 - ---
firefox13 --- fixed
firefox14 --- fixed

People

(Reporter: armenzg, Assigned: gbrown)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file, 1 obsolete file)

I constantly hit this:
> 11 INFO TEST-UNEXPECTED-FAIL | testWebContentContextMenu | Bookmark removal verified - got false, expected true

See log:
http://tinderbox.mozilla.org/showlog.cgi?log=MobileTest/1331736889.1331739106.26798.gz&fulltext=1
I have seen this as well.
I would not expect this failure to be related to the SUT agent upgrade.

I get the same error running locally with adb.
Summary: Opt robocop failure after upgrading to SUT Agent 1.07 upgrade → Opt robocop failure after upgrading to SUT Agent 1.07 upgrade (testWebContentContextMenu | Bookmark removal verified - got false, expected true)
Running locally, I see a sqlite exception prior to this assertion failure:

E/Cursor  ( 1306): Finalizing a Cursor that has not been deactivated or closed. database = /data/data/org.mozilla.fennec_mozdev/databases/browser-default.db, table = history_with_images, query = SELECT _id, url, title, favicon FROM history_with_images WHERE ((deleted = 0) AND ((url LIKE ? OR ti
E/Cursor  ( 1306): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
E/Cursor  ( 1306): 	at android.database.sqlite.SQLiteCursor.<init>(SQLiteCursor.java:212)
E/Cursor  ( 1306): 	at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)
E/Cursor  ( 1306): 	at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1454)
E/Cursor  ( 1306): 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)
E/Cursor  ( 1306): 	at org.mozilla.fennec_mozdev.db.BrowserProvider.query(BrowserProvider.java:1217)
E/Cursor  ( 1306): 	at android.content.ContentProvider$Transport.query(ContentProvider.java:163)
E/Cursor  ( 1306): 	at android.content.ContentResolver.query(ContentResolver.java:245)
E/Cursor  ( 1306): 	at org.mozilla.gecko.db.LocalBrowserDB.filterAllSites(LocalBrowserDB.java:123)
E/Cursor  ( 1306): 	at org.mozilla.gecko.db.LocalBrowserDB.filter(LocalBrowserDB.java:139)
E/Cursor  ( 1306): 	at org.mozilla.gecko.db.BrowserDB.filter(BrowserDB.java:111)
E/Cursor  ( 1306): 	at org.mozilla.gecko.AwesomeBarTabs$3.runQuery(AwesomeBarTabs.java:809)
E/Cursor  ( 1306): 	at android.widget.CursorAdapter.runQueryOnBackgroundThread(CursorAdapter.java:309)
E/Cursor  ( 1306): 	at android.widget.CursorFilter.performFiltering(CursorFilter.java:49)
E/Cursor  ( 1306): 	at android.widget.Filter$RequestHandler.handleMessage(Filter.java:234)
E/Cursor  ( 1306): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/Cursor  ( 1306): 	at android.os.Looper.loop(Looper.java:123)
E/Cursor  ( 1306): 	at android.os.HandlerThread.run(HandlerThread.java:60)
D/Cursor  ( 1306): 
D/Cursor  ( 1306): Database path: /data/data/org.mozilla.fennec_mozdev/databases/browser-default.db
D/Cursor  ( 1306): 
D/Cursor  ( 1306): Table name   : history_with_images
D/Cursor  ( 1306): 
D/Cursor  ( 1306): SQL          : SQLiteQuery: SELECT _id, url, title, favicon FROM history_with_images WHERE ((deleted = 0) AND ((url LIKE ? OR title LIKE ?))) ORDER BY visits * MAX(1, (date - 1331946047846) / 86400000 + 120) DESC LIMIT 100
I/dalvikvm( 1306): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 1306): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@48332638 on history_with_images that has not been deactivated or closed
I/dalvikvm( 1306): 	at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:613)
I/dalvikvm( 1306): 	at dalvik.system.NativeStart.run(Native Method)
D/dalvikvm( 1306): GC_FOR_MALLOC freed 10278 objects / 665152 bytes in 142ms
I/global  ( 1306): Default buffer size used in BufferedWriter constructor. It would be better to be explicit if an 8k-char buffer is required.
I/Robocop ( 1306): 11 INFO TEST-UNEXPECTED-FAIL | testWebContentContextMenu | Bookmark removal verified - got false, expected true
I/global  ( 1306): Default buffer size used in BufferedWriter constructor. It would be better to be explicit if an 8k-char buffer is required.
(In reply to Geoff Brown [:gbrown] from comment #14)
> Running locally, I see a sqlite exception prior to this assertion failure:

Ignore this comment. The exception occurs because the test ends prematurely -- it doesn't cause the failure.
Attached patch sleep after (obsolete) — — Splinter Review
It looks to me like the issue is that the bookmark is not created in the underlying tables before we try to remove it. I tried a few different approaches, but nothing seems to work as well as a simple sleep(). The waitForIdleSync's seem to help a slightly different problem that I occasionally see locally.
Attachment #607066 - Flags: review?(jmaher)
Why 2000?
Comment on attachment 607066 [details] [diff] [review]
sleep after

Review of attachment 607066 [details] [diff] [review]:
-----------------------------------------------------------------

if you cannot come up with a solution for the thread.sleep, at least lets put a todo comment there to figure something out in the future.

::: mobile/android/base/tests/testWebContentContextMenu.java.in
@@ +57,5 @@
>          loadUrl(url);
>  
> +        // Pause briefly, to ensure that the bookmark addition, above, updates database tables and
> +        // completes before checking that the bookmark exists.
> +        try { Thread.sleep(2000); } catch(Exception e) {}

I really really wish we could wait for some event here orcheck a state of something.  Sleeping is nasty stuff.
Attachment #607066 - Flags: review?(jmaher) → review+
Attached patch sleep after adding bookmark — — Splinter Review
Added TODO.

r=jmaher
Attachment #607066 - Attachment is obsolete: true
Attachment #607166 - Flags: review+
Assignee: jmaher → gbrown
Please remove the checkin-needed flag when checking things in...
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0e7fa46a9a43
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
Could we please backport to Aurora?
We don't typically track intermittent test failures, only user facing issues that require changes in the product. That being said, we'd definitely approve this fix for Aurora/Beta since this is just a test change.
Thanks mfinkle!
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: