Intermittent testHomeBanner | Exception caught - java.lang.NullPointerException

RESOLVED FIXED in Firefox 37

Status

()

Firefox for Android
General
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: RyanVM, Assigned: gbrown)

Tracking

({crash, intermittent-failure})

unspecified
Firefox 37
ARM
Android
crash, intermittent-failure
Points:
---

Firefox Tracking Flags

(firefox35 unaffected, firefox36 unaffected, firefox37 fixed, firefox-esr31 unaffected)

Details

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
10:25:17 INFO - SimpleTest START
10:25:17 INFO - TEST-START | testHomeBanner
10:25:17 INFO - TEST-PASS | testHomeBanner | Robocop tests need the test device screen to be powered on. -
10:25:17 INFO - TEST-PASS | testHomeBanner | Given message occurred for registered event: {"type":"Gecko:Ready"} - Gecko:Ready should equal Gecko:Ready
10:25:17 INFO - EventExpecter: no longer listening for Gecko:Ready
10:25:17 INFO - TEST-PASS | testHomeBanner | The HomePager is visible -
10:25:17 INFO - TEST-PASS | testHomeBanner | The HomeBanner is not visible -
10:25:17 INFO - TEST-PASS | testHomeBanner | url is not null - chrome://roboextender/content/robocop_home_banner.html#addMessage should not equal null
10:25:17 INFO - TEST-PASS | testHomeBanner | url is not null - chrome://roboextender/content/robocop_home_banner.html#addMessage should not equal null
10:25:17 INFO - TEST-PASS | testHomeBanner | The toolbar is not in the editing state -
10:25:17 INFO - TEST-PASS | testHomeBanner | Waiting for Toolbar to enter editing mode. -
10:25:17 INFO - TEST-PASS | testHomeBanner | Waiting for UrlEditText to be input method target. -
10:25:17 INFO - TEST-PASS | testHomeBanner | url is not null - chrome://roboextender/content/robocop_home_banner.html#addMessage should not equal null
10:25:17 INFO - TEST-PASS | testHomeBanner | The toolbar is in the editing state -
10:25:17 INFO - TEST-PASS | testHomeBanner | The UrlEditText is the input method target -
10:25:17 INFO - TEST-PASS | testHomeBanner | The toolbar is in the editing state -
10:25:17 INFO - TEST-PASS | testHomeBanner | initiatingAction is not null - org.mozilla.gecko.tests.components.ToolbarComponent$2@4142a9a0 should not equal null
10:25:17 INFO - 0 ERROR Exception caught during test! - java.lang.NullPointerException
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3070)
10:25:17 INFO - at android.widget.ListView.findViewTraversal(ListView.java:3435)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3071)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3071)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3071)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3071)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3071)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3071)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3071)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:3071)
10:25:17 INFO - at android.view.View.findViewById(View.java:12247)
10:25:17 INFO - at android.view.Window.findViewById(Window.java:901)
10:25:17 INFO - at android.app.Activity.findViewById(Activity.java:1794)
10:25:17 INFO - at com.jayway.android.robotium.solo.Getter.getView(Getter.java:118)
10:25:17 INFO - at com.jayway.android.robotium.solo.Getter.getView(Getter.java:137)
10:25:17 INFO - at com.jayway.android.robotium.solo.Solo.getView(Solo.java:1982)
10:25:17 INFO - at com.jayway.android.robotium.solo.Solo.getView(Solo.java:1970)
10:25:17 INFO - at org.mozilla.gecko.tests.components.ToolbarComponent.getToolbarView(ToolbarComponent.java:93)
10:25:17 INFO - at org.mozilla.gecko.tests.components.ToolbarComponent.getUrlTitleText(ToolbarComponent.java:105)
10:25:17 INFO - at org.mozilla.gecko.tests.components.ToolbarComponent.getTitleHelper(ToolbarComponent.java:147)
10:25:17 INFO - at org.mozilla.gecko.tests.components.ToolbarComponent.getPotentiallyInconsistentTitle(ToolbarComponent.java:139)
10:25:17 INFO - at org.mozilla.gecko.tests.helpers.WaitHelper$ToolbarTitleTextChangeVerifier.storeState(WaitHelper.java:157)
10:25:17 INFO - at org.mozilla.gecko.tests.helpers.WaitHelper.waitForPageLoad(WaitHelper.java:84)
10:25:17 INFO - at org.mozilla.gecko.tests.components.ToolbarComponent.commitEditingMode(ToolbarComponent.java:174)
10:25:17 INFO - at org.mozilla.gecko.tests.helpers.NavigationHelper.enterAndLoadUrl(NavigationHelper.java:39)
10:25:17 INFO - at org.mozilla.gecko.tests.testHomeBanner.addBannerMessage(testHomeBanner.java:87)
10:25:17 INFO - at org.mozilla.gecko.tests.testHomeBanner.addBannerTest(testHomeBanner.java:39)
10:25:17 INFO - at org.mozilla.gecko.tests.testHomeBanner.testHomeBanner(testHomeBanner.java:20)
10:25:17 INFO - at java.lang.reflect.Method.invokeNative(Native Method)
10:25:17 INFO - at java.lang.reflect.Method.invoke(Method.java:511)
10:25:17 INFO - at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
10:25:17 INFO - at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
10:25:17 INFO - at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
10:25:17 INFO - at org.mozilla.gecko.tests.UITest.runTest(UITest.java:94)
10:25:17 INFO - at junit.framework.TestCase.runBare(TestCase.java:127)
10:25:17 INFO - at junit.framework.TestResult$1.protect(TestResult.java:106)
10:25:17 INFO - at junit.framework.TestResult.runProtected(TestResult.java:124)
10:25:17 INFO - at junit.framework.TestResult.run(TestResult.java:109)
10:25:17 INFO - at junit.framework.TestCase.run(TestCase.java:118)
10:25:17 INFO - at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
10:25:17 INFO - at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
10:25:17 INFO - at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:545)
10:25:17 INFO - at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1551)
10:25:17 WARNING - TEST-UNEXPECTED-FAIL | testHomeBanner | Exception caught - java.lang.NullPointerException
10:25:17 INFO - TEST-OK | testHomeBanner | took 12789ms
10:25:17 INFO - TEST-START | Shutdown
10:25:17 INFO - Passed: 14
10:25:17 INFO - Failed: 1
10:25:17 INFO - Todo: 0
10:25:17 INFO - SimpleTest FINISHED
Comment hidden (Treeherder Robot)
(Assignee)

Comment 2

3 years ago
Created attachment 8539451 [details]
screenshot from comment 0
(Assignee)

Comment 3

3 years ago
Possible regression from bug 1105792 or bug 1107002.
(Assignee)

Updated

3 years ago
See Also: → bug 1114658
(Assignee)

Updated

3 years ago
See Also: → bug 1114655
(Assignee)

Updated

3 years ago
See Also: bug 1114655
(Assignee)

Comment 4

3 years ago
We've had success avoiding this type of failure with waitForView:

http://hg.mozilla.org/mozilla-central/annotate/67872ce17918/mobile/android/base/tests/components/AboutHomeComponent.java#l72
(Assignee)

Comment 5

3 years ago
Created attachment 8542593 [details] [diff] [review]
waitForView before proceeding

Speculative, but worth a try...
Attachment #8542593 - Flags: review?(michael.l.comella)
Comment on attachment 8542593 [details] [diff] [review]
waitForView before proceeding

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

This is super strange:

10:25:17 INFO - at org.mozilla.gecko.tests.components.ToolbarComponent.commitEditingMode(ToolbarComponent.java:174)
10:25:17 INFO - at org.mozilla.gecko.tests.helpers.NavigationHelper.enterAndLoadUrl(NavigationHelper.java:39)

enterAndLoadUrl calls enterUrl [1] before commitEditingMode where enterUrl calls getUrlEditText [2] which successfully calls getToolbarView [3], which is our crashing friend. So somewhere after entering a url and hitting enter, the toolbar view disappears from the hierarchy! How strange!

Under the assumption that it should return, I'm okay with this fix. However, there are two possibilities I can think of:
  1) Robocop is accessing the views at a time when the hierarchy is incomplete or inaccessible (e.g. maybe layout?) and so this is probably the only fix
  2) We're doing some excessive work during page load that forces the toolbar to hide itself and this solution is covering up our inefficiencies.

If #2, I suppose there are more intuitive ways to do performance testing in UI so we should focus on that route. Thus, this wfm.

[1]: https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/tests/helpers/NavigationHelper.java?rev=9eb089d7c2b9#40
[2]: https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/tests/components/ToolbarComponent.java?rev=51ca6ef95772#201
[3]: https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/tests/components/ToolbarComponent.java?rev=51ca6ef95772#201k
Attachment #8542593 - Flags: review?(michael.l.comella) → review+
Do you have a try run?

Also, I wonder if we shouldn't do this for all of our get*View methods, given comment 6. I'll add some notes to bug 972042.
Flags: needinfo?(gbrown)
See Also: → bug 972042
(Assignee)

Comment 8

3 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=fc12d403667f

Thanks Michael. waitForView before every getView seems like overkill, but I certainly think there are additional opportunities to use this technique.
Flags: needinfo?(gbrown)
(Assignee)

Comment 9

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/4912606fb9c7
https://hg.mozilla.org/mozilla-central/rev/4912606fb9c7
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
(Reporter)

Updated

3 years ago
status-firefox35: --- → unaffected
status-firefox36: --- → unaffected
status-firefox37: --- → fixed
status-firefox-esr31: --- → unaffected
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
You need to log in before you can comment on or make changes to this bug.