Closed Bug 817899 Opened 12 years ago Closed 11 years ago

Intermittent testAllPagesTab | Correct number of ImageViews visible - got 2, expected 1, got 6, expected 2, got 5, expected 2

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: RyanVM, Assigned: gbrown)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

https://tbpl.mozilla.org/php/getParsedLog.php?id=17571307&tree=Mozilla-Inbound

Android Armv6 Tegra 250 mozilla-inbound opt test robocop on 2012-12-03 14:56:06 PST for push af912a40cd59
slave: tegra-277

0 INFO SimpleTest START
1 INFO TEST-START | testAllPagesTab
2 INFO TEST-PASS | testAllPagesTab | Awesomebar URL typed properly - http://mochi.test:8888/tests/robocop/robocop_big_link.html should equal http://mochi.test:8888/tests/robocop/robocop_big_link.html
3 INFO TEST-PASS | testAllPagesTab | Three tabs shown - 3 should equal 3
4 INFO TEST-PASS | testAllPagesTab | Strip is hidden - false should equal false
5 INFO TEST-PASS | testAllPagesTab | checking that all pages list exists - android.widget.ListView@484b0b18
6 INFO TEST-PASS | testAllPagesTab | all pages list has 5 children (the default bookmarks) - 5 should equal 5
7 INFO TEST-PASS | testAllPagesTab | TextView is filled in - Firefox: Customize with add-ons
8 INFO TEST-PASS | testAllPagesTab | TextView is filled in - http://mochi.test:8888/tests/robocop/robocop_big_link.html
9 INFO TEST-PASS | testAllPagesTab | Correct number of ImageViews visible - 1 should equal 1
10 INFO TEST-PASS | testAllPagesTab | TextView is filled in - http://mochi.test:8888/tests/robocop/robocop_big_link.html
11 INFO TEST-PASS | testAllPagesTab | TextView is filled in - Top Sites
12 INFO TEST-PASS | testAllPagesTab | TextView is filled in - Bookmarks
13 INFO TEST-PASS | testAllPagesTab | TextView is filled in - History
14 INFO TEST-PASS | testAllPagesTab | TextView is filled in - Big Link
15 INFO TEST-PASS | testAllPagesTab | TextView is filled in - http://mochi.test:8888/tests/robocop/robocop_big_link.html
16 INFO TEST-UNEXPECTED-FAIL | testAllPagesTab | Correct number of ImageViews visible - got 2, expected 1
Exception caught during test!
junit.framework.AssertionFailedError: 16 INFO TEST-UNEXPECTED-FAIL | testAllPagesTab | Correct number of ImageViews visible - got 2, expected 1
	at junit.framework.Assert.fail(Assert.java:47)
	at org.mozilla.fennec.FennecMochitestAssert._logMochitestResult(FennecMochitestAssert.java:107)
	at org.mozilla.fennec.FennecMochitestAssert.ok(FennecMochitestAssert.java:136)
	at org.mozilla.fennec.FennecMochitestAssert.is(FennecMochitestAssert.java:142)
	at org.mozilla.fennec.tests.testAllPagesTab.testList(testAllPagesTab.java:111)
	at org.mozilla.fennec.tests.testAllPagesTab.testAllPagesTab(testAllPagesTab.java:55)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:521)
	at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)
	at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)
	at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)
	at org.mozilla.fennec.tests.BaseTest.runTest(BaseTest.java:120)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
17 INFO TEST-UNEXPECTED-FAIL | testAllPagesTab | Exception caught - junit.framework.AssertionFailedError: 16 INFO TEST-UNEXPECTED-FAIL | testAllPagesTab | Correct number of ImageViews visible - got 2, expected 1
18 INFO TEST-END | testAllPagesTab | finished in 29492ms
19 INFO TEST-START | Shutdown
20 INFO Passed: 14
21 INFO Failed: 2
22 INFO Todo: 0
23 INFO SimpleTest FINISHED
Regression from bug 759041?
Summary: Intermittent testAllPagesTab | Correct number of ImageViews visible - got 2, expected 1 → Intermittent testAllPagesTab | Correct number of ImageViews visible - got 2, expected 1, got 6, expected 2, got 5, expected 2
Assignee: nobody → gbrown
An interesting clue from Comment 12:

6 INFO TEST-PASS | testAllPagesTab | TextView is filled in - http://mochi.test:8888/tests/robocop/robocop_big_link.html
7 INFO TEST-PASS | testAllPagesTab | TextView is filled in - Top Sites
8 INFO TEST-PASS | testAllPagesTab | TextView is filled in - Bookmarks
9 INFO TEST-PASS | testAllPagesTab | TextView is filled in - History
10 INFO TEST-PASS | testAllPagesTab | TextView is filled in - Big Link
11 INFO TEST-PASS | testAllPagesTab | TextView is filled in - http://mochi.test:8888/tests/robocop/robocop_big_link.html

How are the awesome bar tabs showing up in the ListView?

There is a very similar issue here (same problem, different test, bug 825518): https://tbpl.mozilla.org/php/getParsedLog.php?id=20390086&full=1&branch=mozilla-beta#error0
See Also: → 825518
I was able to reproduce the problem noted in Comment 13 reliably on my Galaxy S and determined that list.getChildAt() was returning null. The null return was going undetected, resulting in a later call to mSolo.getViews(null) which rather than returning the views associated with the list child was returning all of the views, including those containing the awesome bar tab labels!

We have noted elsewhere the perils of using ListView.getChildCount -- if part of the ListView is obscured or offscreen, not all items may be included in the count. Now that we have replaced getChildCount with getAdapter().getCount(), we seem to face a similar issue when we actually retrieve the children: ListView.getChild may return null if that item is obscured or offscreen.
I reviewed our use of ListView.getChildAt across all robocop tests. Where we scan through the child views of a list, this patch allows getChildAt to return null without causing a test failure. This "dilutes" some tests (makes those tests less strict), but I think this is only reasonable: We should not try to verify that UI list items are populated when they might be off-screen or obscured by the VKB. 

In several cases, tests check just the first item in a list. Since we have not seen failures associated with these checks, and generally expect the first item of a list to be visible, I have added explicit checks for getChildAt failures. These might produce new intermittent failure reports, but with explicit assertion messages that should be simple to address.
Attachment #723570 - Flags: review?(jmaher)
Comment on attachment 723570 [details] [diff] [review]
review/correct use of ListView.getChildAt

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

thanks for explaining this in the description of this patch.
Attachment #723570 - Flags: review?(jmaher) → review+
https://hg.mozilla.org/mozilla-central/rev/019f5532e8cb
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: