Closed Bug 1330323 Opened 3 years ago Closed 3 years ago

Intermittent test_execute_script.py TestExecuteChrome.* | UnsupportedOperationException: Only supported in Firefox

Categories

(Testing :: Marionette, defect)

Version 3
defect
Not set

Tracking

(firefox51 unaffected, firefox52 fixed, firefox53 fixed)

RESOLVED FIXED
mozilla53
Tracking Status
firefox51 --- unaffected
firefox52 --- fixed
firefox53 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: whimboo)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Comment on attachment 8825834 [details]
Bug 1330323 - Fix test failures in test_execute_script for Fennec.

https://reviewboard.mozilla.org/r/103908/#review104580

::: testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py:197
(Diff revision 1)
> +        try:
> -        self.marionette.execute_script("window.wrappedJSObject.foo = 3")
> +            self.marionette.execute_script("window.wrappedJSObject.foo = 3")
> -        self.assertEqual(
> +            self.assertEqual(
> -            3, self.marionette.execute_script("return window.wrappedJSObject.foo"))
> +                self.marionette.execute_script("return window.wrappedJSObject.foo"), 3)
> +        finally:
> +            self.marionette.execute_script("delete window.wrappedJSObject.foo")

Andreas, do you know why it is necessary to reset the property? If we don't do it here the test_exception() will fail because it checks for the same property as not existent.
Attachment #8825834 - Flags: review?(ato)
Comment on attachment 8825834 [details]
Bug 1330323 - Fix test failures in test_execute_script for Fennec.

https://reviewboard.mozilla.org/r/103908/#review104580

> Andreas, do you know why it is necessary to reset the property? If we don't do it here the test_exception() will fail because it checks for the same property as not existent.

This is because `execute_script` without a `sandbox` kwarg gets executed in the same sandbox, which means `window.wrappedJSObject.foo` and the `window` state is being preserved.  So the adding a finally-block here makes total sense and is the correct solution.
Comment on attachment 8825834 [details]
Bug 1330323 - Fix test failures in test_execute_script for Fennec.

https://reviewboard.mozilla.org/r/103908/#review104594
Attachment #8825834 - Flags: review?(ato) → review+
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d22302d25085
Fix test failures in test_execute_script for Fennec. r=ato
Patch landed few hours ago https://hg.mozilla.org/mozilla-central/rev/d22302d25085
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Please uplift this test-only patch to aurora. Thanks.
Whiteboard: [checkin-needed-aurora]
https://hg.mozilla.org/releases/mozilla-aurora/rev/36f85907a16e
Flags: in-testsuite+
Whiteboard: [checkin-needed-aurora]
You need to log in before you can comment on or make changes to this bug.