Closed Bug 1113754 Opened 9 years ago Closed 9 years ago

Intermittent testHomeBanner | Exception caught - java.lang.NullPointerException

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

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

RESOLVED FIXED
Firefox 37
Tracking Status
firefox35 --- unaffected
firefox36 --- unaffected
firefox37 --- fixed
firefox-esr31 --- unaffected

People

(Reporter: RyanVM, Assigned: gbrown)

References

Details

(Keywords: crash, intermittent-failure)

Attachments

(2 files)

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
Possible regression from bug 1105792 or bug 1107002.
See Also: → 1114658
See Also: → 1114655
See Also: 1114655
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: → 972042
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)
https://hg.mozilla.org/mozilla-central/rev/4912606fb9c7
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.