Closed Bug 1368526 Opened 7 years ago Closed 7 years ago

Intermittent test_window_handles_chrome.py TestWindowHandles.test_window_handles_after_closing_original_tab | AssertionError: u'about:blank' != 'http://127.0.0.1:49337/empty.html'

Categories

(Testing :: Marionette Client and Harness, defect)

Version 3
defect
Not set
normal

Tracking

(firefox-esr52 fixed, firefox54 fixed, firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox-esr52 --- fixed
firefox54 --- fixed
firefox55 --- fixed

People

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

References

Details

(Keywords: intermittent-failure)

User Story

To get started on this bug for Marionette please consult the documentation for new contributors:

https://wiki.mozilla.org/User:Mjzffr/New_Contributors

Attachments

(2 files)

Attached image screenshot.png
09:49:27    ERROR -  TEST-UNEXPECTED-FAIL | test_window_handles_chrome.py TestWindowHandles.test_window_handles_after_closing_original_tab | AssertionError: u'about:blank' != 'http://127.0.0.1:49337/empty.html'
09:49:27     INFO -  Traceback (most recent call last):
09:49:27     INFO -    File "C:\slave\test\build\venv\lib\site-packages\marionette_harness\marionette_test\testcases.py", line 166, in run
09:49:27     INFO -      testMethod()
09:49:27     INFO -    File "C:\slave\test\build\tests\marionette\tests\testing\marionette\harness\marionette_harness\tests\unit\test_window_handles_chrome.py", line 193, in test_window_handles_after_closing_original_tab
09:49:27     INFO -      self.assertEqual(self.marionette.get_url(), self.empty_page)

The screenshot shows that we are still loading the page. So we miss to wait for the empty page being loaded after switching to the newly opened tab:

https://dxr.mozilla.org/mozilla-central/rev/4541134e973a6bd5e667a603e844854c8e5361da/testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_chrome.py#180-193

So in line 193 we would need a call to `Wait().until()` instead of `assertEqual` with the timeout being the page load timeout. An example can be found in the test file `test_modal_dialogs.py` which is located in the same directory.

Please note that other tests in this file might also be affected by this race condition.
Mentor: hskupin
User Story: (updated)
Keywords: good-first-bug
Whiteboard: [lang=py]
I will pick this up myself given that we have a huge increase in those failures now.
Assignee: nobody → hskupin
Mentor: hskupin
Status: NEW → ASSIGNED
Keywords: good-first-bug
Whiteboard: [lang=py]
Blocks: 1340817
Attachment #8872560 - Flags: review?(ato)
Comment on attachment 8872560 [details]
Bug 1368526 - Wait for the page to be loaded in a newly opened tab/window.

https://reviewboard.mozilla.org/r/144090/#review147892

::: commit-message-34ac1:1
(Diff revision 1)
> +Bug 1368526 - Ensure to wait for the page being loaded in a newly opened tab/window.

s/Ensure to wait for the page being loaded/Wait for the page to load/
Attachment #8872560 - Flags: review?(ato) → review+
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4c6b36ee9f17
Wait for the page to be loaded in a newly opened tab/window. r=ato
https://hg.mozilla.org/mozilla-central/rev/4c6b36ee9f17
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
The tests were introduced via bug 1323185, and got uplifted to 52. So I would request an uplift of this fix to both beta and esr52.
Blocks: 1323185
Whiteboard: [checkin-needed-beta][checkin-needed-esr52]
Removing uplift request due to a possible regression. More information to come.
Whiteboard: [checkin-needed-beta][checkin-needed-esr52]
Depends on: 1369083
After some more investigation I doubt that this change has caused bug 1369083. But for safety lets get this landed on beta only for now. If it's fine I will request uplift for esr52 afterward.
Whiteboard: [checkin-needed-beta]
Needs rebasing for Beta.
Flags: needinfo?(hskupin)
Whiteboard: [checkin-needed-beta]
The backport patch can be found as commit 4ea830827bf0 in the following try build:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=76ca873907d738355466ef83b68951fb1d9ec1ca
Flags: needinfo?(hskupin)
Whiteboard: [checkin-needed-beta]
Beta looks fine. So please also uplift this test-only patch to esr52. Thanks.
Whiteboard: [checkin-needed-esr52]
Product: Testing → Remote Protocol
Moving bug to Testing::Marionette Client and Harness component per bug 1815831.
Component: Marionette → Marionette Client and Harness
Product: Remote Protocol → Testing
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: