Intermittent testDistribution | Exception caught - java.lang.NullPointerException

RESOLVED WORKSFORME

Status

()

Firefox for Android
Testing
RESOLVED WORKSFORME
4 years ago
2 years ago

People

(Reporter: RyanVM, Assigned: gbrown)

Tracking

({crash, intermittent-failure})

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
04:34:58 INFO - SimpleTest START
04:34:58 INFO - TEST-START | testDistribution
04:34:58 INFO - TEST-PASS | testDistribution | Robocop tests need the test device screen to be powered on. -
04:34:58 INFO - Background task completed. Proceeding.
04:34:58 INFO - Clearing distribution pref.
04:34:58 INFO - TEST-PASS | testDistribution | Given message occurred for registered event: {"type":"Distribution:Set:OK"} - Distribution:Set:OK should equal Distribution:Set:OK
04:34:58 INFO - EventExpecter: no longer listening for Distribution:Set:OK
04:34:58 INFO - TEST-PASS | testDistribution | waiting for urlbar text to gain focus - urlbar text gained focus
04:34:58 INFO - TEST-PASS | testDistribution | URL typed properly - about:blank should equal about:blank
04:34:58 INFO - TEST-PASS | testDistribution | Given message occurred for registered event: {"bgColor":"transparent","errorType":"","type":"DOMContentLoaded","metadata":null,"tabID":0} - DOMContentLoaded should equal DOMContentLoaded
04:34:58 INFO - EventExpecter: no longer listening for DOMContentLoaded
04:34:58 INFO - TEST-PASS | testDistribution | waiting for urlbar text to gain focus - urlbar text gained focus
04:34:58 INFO - TEST-PASS | testDistribution | URL typed properly - about:home should equal about:home
04:34:58 INFO - TEST-PASS | testDistribution | Given message occurred for registered event: {"bgColor":"transparent","errorType":"","type":"DOMContentLoaded","metadata":null,"tabID":0} - DOMContentLoaded should equal DOMContentLoaded
04:34:58 INFO - EventExpecter: no longer listening for DOMContentLoaded
04:34:58 INFO - TEST-PASS | testDistribution | Found tile: Distribution 1
04:34:58 INFO - TEST-PASS | testDistribution | Given message occurred for registered event: {"response":"{\"click\":0,\"locale\":\"en-US\",\"tiles\":[{\"id\":123},{\"id\":456},{},{},{},{}]}","type":"Robocop:TilesResponse"} - Robocop:TilesResponse should equal Robocop:TilesResponse
04:34:58 INFO - TEST-PASS | testDistribution | JSON click index matched - 0 should equal 0
04:34:58 INFO - TEST-PASS | testDistribution | JSON locale code matched - en-US should equal en-US
04:34:58 INFO - TEST-PASS | testDistribution | JSON tiles data matched - [{"id":123},{"id":456},{},{},{},{}] should equal [{"id":123},{"id":456},{},{},{},{}]
04:34:58 INFO - TEST-PASS | testDistribution | waiting for urlbar text to gain focus - urlbar text gained focus
04:34:58 INFO - 0 ERROR Exception caught during test! - java.lang.NullPointerException
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1760)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.widget.ListView.findViewTraversal(ListView.java:3355)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.ViewGroup.findViewTraversal(ViewGroup.java:1761)
04:34:58 INFO - at android.view.View.findViewById(View.java:7904)
04:34:58 INFO - at android.view.Window.findViewById(Window.java:741)
04:34:58 INFO - at android.app.Activity.findViewById(Activity.java:1647)
04:34:58 INFO - at com.jayway.android.robotium.solo.Getter.getView(Getter.java:118)
04:34:58 INFO - at com.jayway.android.robotium.solo.Getter.getView(Getter.java:137)
04:34:58 INFO - at com.jayway.android.robotium.solo.Solo.getView(Solo.java:1982)
04:34:58 INFO - at com.jayway.android.robotium.solo.Solo.getView(Solo.java:1970)
04:34:58 INFO - at org.mozilla.gecko.tests.BaseTest.enterUrl(BaseTest.java:224)
04:34:58 INFO - at org.mozilla.gecko.tests.BaseTest.inputAndLoadUrl(BaseTest.java:255)
04:34:58 INFO - at org.mozilla.gecko.tests.testDistribution.checkTilesReporting(testDistribution.java:455)
04:34:58 INFO - at org.mozilla.gecko.tests.testDistribution.testDistribution(testDistribution.java:138)
04:34:58 INFO - at java.lang.reflect.Method.invokeNative(Native Method)
04:34:58 INFO - at java.lang.reflect.Method.invoke(Method.java:507)
04:34:58 INFO - at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)
04:34:58 INFO - at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)
04:34:58 INFO - at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)
04:34:58 INFO - at org.mozilla.gecko.tests.BaseTest.runTest(BaseTest.java:159)
04:34:58 INFO - at junit.framework.TestCase.runBare(TestCase.java:127)
04:34:58 INFO - at junit.framework.TestResult$1.protect(TestResult.java:106)
04:34:58 INFO - at junit.framework.TestResult.runProtected(TestResult.java:124)
04:34:58 INFO - at junit.framework.TestResult.run(TestResult.java:109)
04:34:58 INFO - at junit.framework.TestCase.run(TestCase.java:118)
04:34:58 INFO - at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
04:34:58 INFO - at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
04:34:58 INFO - at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529)
04:34:58 INFO - at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1448)
04:34:58 INFO -
04:34:58 WARNING - TEST-UNEXPECTED-FAIL | testDistribution | Exception caught - java.lang.NullPointerException
04:34:58 INFO - TEST-PASS | testDistribution | clean up mock package - deleted /data/data/org.mozilla.fennec/mock-package.zip
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/bookmarks.json
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/searchplugins/common/engine.xml
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/searchplugins/common
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/searchplugins
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/suggestedsites/locales/en-US/suggestedsites.json
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/suggestedsites/locales/en-US
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/suggestedsites/locales
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/suggestedsites
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution/preferences.json
04:34:58 INFO - TEST-PASS | testDistribution | clean up distribution files - deleted /data/data/org.mozilla.fennec/distribution
04:34:58 INFO - Clearing distribution pref.
04:34:58 INFO - TEST-OK | testDistribution | took 73371ms
04:34:58 INFO - TEST-START | Shutdown
04:34:58 INFO - Passed: 25
04:34:58 INFO - Failed: 1
04:34:58 INFO - Todo: 0
04:34:58 INFO - SimpleTest FINISHED
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
(Assignee)

Updated

3 years ago
Depends on: 923109
Comment hidden (Treeherder Robot)
(Assignee)

Comment 6

3 years ago
Still using inputAndLoadUrl...

11:50:05     INFO -  0 ERROR Exception caught during test! - java.lang.NullPointerException
11:50:05     INFO -  	at com.jayway.android.robotium.solo.Waiter.waitForView(Waiter.java:303)
11:50:05     INFO -  	at com.jayway.android.robotium.solo.Solo.waitForView(Solo.java:289)
11:50:05     INFO -  	at com.jayway.android.robotium.solo.Solo.waitForView(Solo.java:257)
11:50:05     INFO -  	at org.mozilla.gecko.tests.BaseTest$1.isSatisfied(BaseTest.java:200)
11:50:05     INFO -  	at com.jayway.android.robotium.solo.Waiter.waitForCondition(Waiter.java:370)
11:50:05     INFO -  	at com.jayway.android.robotium.solo.Solo.waitForCondition(Solo.java:426)
11:50:05     INFO -  	at org.mozilla.gecko.tests.BaseTest.waitForCondition(BaseTest.java:327)
11:50:05     INFO -  	at org.mozilla.gecko.tests.BaseTest.focusUrlBar(BaseTest.java:197)
11:50:05     INFO -  	at org.mozilla.gecko.tests.BaseTest.enterUrl(BaseTest.java:213)
11:50:05     INFO -  	at org.mozilla.gecko.tests.BaseTest.inputAndLoadUrl(BaseTest.java:249)
11:50:05     INFO -  	at org.mozilla.gecko.tests.testDistribution.checkTilesReporting(testDistribution.java:474)
11:50:05     INFO -  	at org.mozilla.gecko.tests.testDistribution.testDistribution(testDistribution.java:142)
Assignee: nobody → gbrown
(Assignee)

Updated

3 years ago
Component: General → Testing
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
(Assignee)

Comment 11

3 years ago
:bnicholson -- Do you recall how this "Slight hack" works?

http://hg.mozilla.org/mozilla-central/annotate/f986e55c4e0b/mobile/android/tests/browser/robocop/testDistribution.java#l482

    public void checkTilesReporting(String localeCode) throws JSONException {
        // Slight hack: Force top sites grid to reload.	
        inputAndLoadUrl(mStringHelper.ABOUT_BLANK_URL);
        inputAndLoadUrl(mStringHelper.ABOUT_HOME_URL);

The NPEs in this bug are a known weakness of inputAndLoadUrl(). I have been trying to replace inputAndLoadUrl() with loadUrlAndWait(), but when I do that here, the distribution tiles are subsequently missing from about:home, even if I add a significant wait after each one (it doesn't seem to be a timing issue).

loadUrlAndWait() uses Tabs.loadUrl(); inputAndLoadUrl() types into the url bar.
Flags: needinfo?(bnicholson)
It just works by leaving about:home and returning to it, which should trigger reloading the thumbnails. I don't see why there would be difference between those two methods...
Flags: needinfo?(bnicholson)
Comment hidden (Treeherder Robot)
(Assignee)

Comment 14

3 years ago
I also tried changing about:blank to a real page:

-        inputAndLoadUrl(mStringHelper.ABOUT_BLANK_URL);
-        inputAndLoadUrl(mStringHelper.ABOUT_HOME_URL);
+        loadUrlAndWait(getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL));
+        verifyUrlBarTitle(getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL));
+        loadUrlAndWait(mStringHelper.ABOUT_HOME_URL);
+        verifyUrlBarTitle(mStringHelper.ABOUT_HOME_URL);

This was better in that the distribution tiles were then missing *intermittently* -- the test passed sometimes.


I am confident that the change from inputAndLoadUrl to loadUrlAndWait is the right solution to the NPEs in this bug, but I haven't been able to determine why that introduces this new problem of missing distribution tiles. I don't have time to investigate further just now.
Assignee: gbrown → nobody
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
(Assignee)

Comment 19

2 years ago
No recent failures of this type, and the test has changed significantly.
Assignee: nobody → gbrown
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.