Closed Bug 820322 Opened 9 years ago Closed 9 years ago

Intermittent testHistoryTab | Exception caught - java.lang.NullPointerException (at org.mozilla.fennec.tests.testHistoryTab.testList(testHistoryTab.java:79))

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 20

People

(Reporter: emorley, Assigned: gbrown)

Details

(Keywords: intermittent-failure)

Attachments

(2 files)

Android Armv6 Tegra 250 mozilla-inbound opt test robocop on 2012-12-06 11:16:11 PST for push 4ebcfbe3c2f8

slave: tegra-130

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

{
1 INFO TEST-START | testHistoryTab
2 INFO TEST-PASS | testHistoryTab | 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 | testHistoryTab | Awesomebar URL typed properly - http://mochi.test:8888/tests/robocop/robocop_blank_01.html should equal http://mochi.test:8888/tests/robocop/robocop_blank_01.html
4 INFO TEST-PASS | testHistoryTab | bookmark added successfully - true should equal true
Exception caught during test!
java.lang.NullPointerException
	at org.mozilla.fennec.tests.testHistoryTab.testList(testHistoryTab.java:79)
	at org.mozilla.fennec.tests.testHistoryTab.testHistoryTab(testHistoryTab.java:68)
	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)
5 INFO TEST-UNEXPECTED-FAIL | testHistoryTab | Exception caught - java.lang.NullPointerException
}
The NPE here happens when listview is null and we call listview.toString() in ok(). My main purpose here is to avoid the NPE. I changed ok() to isnot(listview, null, ...). The new success message is:

5 INFO TEST-PASS | testHistoryTab | checking that history list exists - android.widget.ExpandableListView@4899c820 should not equal null

I am not sure about why/how we get a null listview, but made some minor changes to getHistoryList to see if that helps.
Attachment #690911 - Flags: review?(wjohnston)
Assignee: nobody → gbrown
Comment on attachment 690911 [details] [diff] [review]
avoid NPE in testHistoryTab

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

::: mobile/android/base/tests/testHistoryTab.java.in
@@ +31,5 @@
>  
>  public class testHistoryTab extends PixelTest {
>      private static final String ABOUT_HOME_URL = "about:home";
>      private static final String OPEN_NEW_TAB = "Open in New Tab";
> +    private static final int WAIT_FOR_CHILD_TIMEOUT = 4000;

Just checking that you're ok with bumping this.
Attachment #690911 - Flags: review?(wjohnston) → review+
Yes. Historically, I have resisted increasing timeouts, reasoning that waiting for more than a couple of seconds for a reaction may indicate a non-responsive UI. But lately I have been wondering if some of the infrequent intermittent errors might indicate nothing more than a busy test machine -- a temporary lack of responsiveness unrelated to the test or the software under test.
https://hg.mozilla.org/mozilla-central/rev/e1903c2b01ae
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
I should have made the null check change to all of the code with that vulnerability -- here it is now. I also noticed this string == usage, which makes me nervous.
Attachment #694066 - Flags: review?(wjohnston)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #694066 - Flags: review?(wjohnston) → review+
https://hg.mozilla.org/mozilla-central/rev/8793edbf2a32
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.