Closed Bug 785577 Opened 12 years ago Closed 12 years ago

Intermittent testWebContentContextMenu | Exception caught - junit.framework.AssertionFailedError: looking for context menu action - found 'Open Link in New Tab' (formerly 'The text: Open is not found!

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME
Firefox 18

People

(Reporter: philor, Unassigned)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

https://tbpl.mozilla.org/php/getParsedLog.php?id=14655963&tree=Firefox#error3
Android Tegra 250 mozilla-central opt test robocop on 2012-08-23 20:37:33 PDT for push 29ca472bf2d2
slave: tegra-080

3 INFO TEST-PASS | testWebContentContextMenu | looking for context menu action - found 'Open Link'
Exception caught during test!
junit.framework.AssertionFailedError: The text: Open is not found!
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at com.jayway.android.robotium.solo.Clicker.clickOnText(Clicker.java:291)
	at com.jayway.android.robotium.solo.Solo.clickOnText(Solo.java:823)
	at org.mozilla.fennec.tests.testWebContentContextMenu.testWebContentContextMenu(testWebContentContextMenu.java:34)
	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:94)
	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)
4 INFO TEST-UNEXPECTED-FAIL | testWebContentContextMenu | Exception caught - junit.framework.AssertionFailedError: The text: Open is not found!
5 INFO TEST-END | testWebContentContextMenu | finished in 35787ms

https://tbpl.mozilla.org/php/getParsedLog.php?id=14681969&tree=Mozilla-Inbound
Android Tegra 250 mozilla-inbound opt test robocop on 2012-08-24 14:24:44 PDT for push 68a243c559b2
slave: tegra-037

3 INFO TEST-PASS | testWebContentContextMenu | looking for context menu action - found 'Open Link'
Exception caught during test!
junit.framework.AssertionFailedError: The text: Open is not found!
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at com.jayway.android.robotium.solo.Clicker.clickOnText(Clicker.java:291)
	at com.jayway.android.robotium.solo.Solo.clickOnText(Solo.java:823)
	at org.mozilla.fennec.tests.testWebContentContextMenu.testWebContentContextMenu(testWebContentContextMenu.java:34)
	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:94)
	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)
4 INFO TEST-UNEXPECTED-FAIL | testWebContentContextMenu | Exception caught - junit.framework.AssertionFailedError: The text: Open is not found!
5 INFO TEST-END | testWebContentContextMenu | finished in 34466ms
See Also: → 770461
Assignee: nobody → gbrown
I have not had much luck consistently reproducing this problem, but my suspicion is that - as we have seen in some other cases - loadUrl does not ensure that the page is functional. The test may be getting the wrong sizes and clicking in the wrong place, or the long-click may not be associated with the link yet.

The main change here is to change loadUrl to loadAndPaint, to ensure that the link is actually displayed before we try to click on it.

At the same time, I have added comments and tightened up the checks for text -- checking for 'Open Link in New Tab' instead of just 'Open', etc.
Attachment #664527 - Flags: review?(jmaher)
Comment on attachment 664527 [details] [diff] [review]
improve wait for load before testing menus

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

seems like a lot of menu items changed :(

::: mobile/android/base/tests/testWebContentContextMenu.java.in
@@ +31,2 @@
>  
> +        mAsserter.dumpLog("long-clicking at "+left+", "+top);

seems like extra debugging here...we should ensure we cleanup these extra debugging lines after we achieve no more oranges!
Attachment #664527 - Flags: review?(jmaher) → review+
https://hg.mozilla.org/mozilla-central/rev/051d7855b93f
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 18
The patch changed the wording of the error, and may have reduced the rate of incidence, but the problem persists.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Summary: Intermittent testWebContentContextMenu | Exception caught - junit.framework.AssertionFailedError: The text: Open is not found! → Intermittent testWebContentContextMenu | Exception caught - junit.framework.AssertionFailedError: looking for context menu action - found 'Open Link in New Tab'
Top-orange; disabled for now:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d74e4032a867
Whiteboard: [orange] → [orange][test disabled][leave open]
Summary: Intermittent testWebContentContextMenu | Exception caught - junit.framework.AssertionFailedError: looking for context menu action - found 'Open Link in New Tab' → Intermittent testWebContentContextMenu | Exception caught - junit.framework.AssertionFailedError: looking for context menu action - found 'Open Link in New Tab' (formerly 'The text: Open is not found!
Whiteboard: [orange][test disabled][leave open] → [orange][leave open]
I don't see any new failures on m-c/m-i. Probably best to leave open for now in case there is still an intermittent problem...
Assignee: gbrown → nobody
I'm happy to close this WFM and reopen if it gets starred again :-)
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → WORKSFORME
Whiteboard: [orange][leave open] → [orange]
Whiteboard: [orange]
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: