Closed
Bug 1084412
Opened 10 years ago
Closed 10 years ago
searchTimeout doesn't work when using findElements
Categories
(Remote Protocol :: Marionette, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla36
People
(Reporter: ahal, Assigned: ahal)
References
Details
Attachments
(2 files, 1 obsolete file)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
ahal
:
review+
|
Details | Diff | Splinter Review |
I noticed that searchTimeout doesn't work when using marionette.find_elements(). This is because the findElements() function [1] returns "[]" if no elements were found. But since !![] == true, this if statement [2] always evaluates to true, meaning we return the empty list immediately rather than waiting for searchTimeout.
Test case that fails attached.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
The included test fails without this patch and works with it.
Comment 3•10 years ago
|
||
Comment on attachment 8506996 [details] [diff] [review]
Fix findElements so it honours searchTimeout
Review of attachment 8506996 [details] [diff] [review]:
-----------------------------------------------------------------
::: testing/marionette/client/marionette/tests/unit/test_findelement.py
@@ +130,5 @@
> self.assertRaises(NoSuchElementException, self.marionette.find_element, By.ID, "newDiv")
> self.assertTrue(True, self.marionette.set_search_timeout(8000))
> self.assertEqual(HTMLElement, type(self.marionette.find_element(By.ID, "newDiv")))
>
> + def test_timeout_elements(self):
I know you copied this from the singular version but the assumptions are wrong...
Can you raise a bug to have these checked since you should set the search timeout whenever and carry on as normal
Attachment #8506996 -
Flags: review?(dburns) → review+
Assignee | ||
Comment 4•10 years ago
|
||
I don't see what you mean, could you clarify what assumption is wrong?
Flags: needinfo?(dburns)
Comment 5•10 years ago
|
||
This is how I would expect the test to be written
> test_html = self.marionette.absolute_url("test.html")
> self.marionette.navigate(test_html)
> self.assertEqual(len(self.marionette.find_elements(By.ID, "newDiv")), 0)
> self.marionette.set_search_timeout(8000)
> button = self.marionette.find_element("id", "createDivButton")
> button.click()
> self.assertEqual(len(self.marionette.find_elements(By.ID, "newDiv")), 1)
It feels like we could fail on `> self.assertEqual(len(self.marionette.find_elements(By.ID, "newDiv")), 0)` if we are on a slow machine.
I dont see this as affecting the landing of your patch. I just think these tests need to be audited
Flags: needinfo?(dburns)
Assignee | ||
Comment 6•10 years ago
|
||
The 'test.html' page that gets loaded does a 2 second delay before creating the element the tests are looking for:
http://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/www/test.html#15
Though I guess there's still technically a race condition, so I don't mind filing a follow up.
Assignee | ||
Comment 7•10 years ago
|
||
Comment 8•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Comment 9•10 years ago
|
||
Andrew, David - This is causing multiple JSMarionette test suite failures, and our tree is closed because of it. Can it be backed out until we adjust our tests to work with this?
Flags: needinfo?(dburns)
Flags: needinfo?(ahalberstadt)
Comment 10•10 years ago
|
||
checkin-needed: Can I request a backout here so we can reopen gaia trees?
Keywords: checkin-needed
Comment 11•10 years ago
|
||
Removing checkin-needed for the backout. It seems Tim has found the problem in bug 1087038, so I suppose we should try to go with a proper fix for now.
Keywords: checkin-needed
Updated•10 years ago
|
Flags: needinfo?(dburns)
Flags: needinfo?(ahalberstadt)
Assignee | ||
Comment 12•10 years ago
|
||
Ah, apologies. This was my first marionette server patch and I neglected to look at the gaia trees. I'll remember to do so next time.
Assignee | ||
Comment 13•10 years ago
|
||
I backed this out since bug 1087038 still isn't fixed:
https://hg.mozilla.org/mozilla-central/rev/305d24174ace
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 14•10 years ago
|
||
Should I land this directly on m-i/b-i as well? Or should we merge it there.. not sure how this works.
Comment 15•10 years ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #14)
> Should I land this directly on m-i/b-i as well? Or should we merge it
> there.. not sure how this works.
The backout patch was merged from m-c to m-i earlier:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6066a2a0766f
Comment 16•10 years ago
|
||
:ahal, you might want to try reland your patch (with mine squash on it), after testing Gij with this try syntax:
try: -b o -p linux64_gecko -u all -t none
Note that the tests are hidden.
Assignee | ||
Comment 17•10 years ago
|
||
I stepped away from this for a bit until bug 1080764 was finished. This patch is the same as before except with Tim's patch from bug 1087038 qfolded on top. Since both patches were individually r+'ed by AutomatedTester, carrying r+ forward.
From reading bug 1087038, it looks like maybe Tim's patch was all that was needed after all and that this got mistakenly backed out.
Here's a try run to verify:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=ca9443b50d7a
Attachment #8506996 -
Attachment is obsolete: true
Attachment #8513694 -
Flags: review+
Assignee | ||
Comment 18•10 years ago
|
||
This is still breaking Gij even with Tim's patch. I looked at one of the errors for the clock tests..
This call to waitFor [1] is timing out. That suggests that the "$(selector).tap()" call above isn't working. I poked around and $(selector) is indeed using findElements [2], so my change is definitely exposing this.
This suggests two things to me:
1) The call to findElements isn't working, but no errors are thrown/logged. Seems like mquery.js should raise if no elements were found.
2) marionette-js-client is somehow depending on the broken behaviour of marionette server's findElements and needs to be updated, or there's still a subtle error in this patch.
I can't figure this out just by inspecting, I'll need to set up a gaia-integration environment to test further.
Assignee | ||
Comment 19•10 years ago
|
||
Assignee | ||
Comment 20•10 years ago
|
||
I filed bug 1091783 to look into the Gij test failures this patch causes. I figured out why the clock tests were failing and uploaded a patch there. Now it's just a matter of looking into the other chunks and coordinating the landing.
Assignee | ||
Comment 21•10 years ago
|
||
Now that bug 1091783 is fixed, here's a new try run:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=f3f05dadc96c&searchQuery=js-integration
The failed '1' looks like infrastructure issues, while the failed '3' I believe is a known intermittent (at least I saw a similar job with the same failure). So I think this is good to land. Just waiting on inbound being open.
Assignee | ||
Comment 22•10 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•