Closed Bug 1189824 Opened 9 years ago Closed 9 years ago

Intermittent failure in test_add_to_new_contact_from_messages.py

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: martijn.martijn)

References

()

Details

Attachments

(1 file)

I thought this would have been fixed by bug 1188974, but it seems to be still lurking around.
Not sure what's going on here, I haven't been able to reproduce myself yet.

http://jenkins1.qa.scl3.mozilla.com/view/Mozilla%20Lab/job/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/380/HTML_Report/
Traceback (most recent call last):
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_client-0.16-py2.7.egg/marionette/marionette_test.py", line 296, in run
testMethod()
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/tests/python/gaia-ui-tests/gaiatest/tests/functional/messages/test_add_to_new_contact_from_messages.py", line 48, in test_sms_create_new_contact
self.wait_for_condition(lambda m: self.message_thread.header_text == self.contact['name'])
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/tests/python/gaia-ui-tests/gaiatest/gaia_test.py", line 1118, in wait_for_condition
Wait(self.marionette, timeout).until(method, message=message)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/wait.py", line 122, in until
rv = condition(self.marionette)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/tests/python/gaia-ui-tests/gaiatest/tests/functional/messages/test_add_to_new_contact_from_messages.py", line 48, in <lambda>
self.wait_for_condition(lambda m: self.message_thread.header_text == self.contact['name'])
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/tests/python/gaia-ui-tests/gaiatest/apps/messages/regions/message_thread.py", line 52, in header_text
expected.element_present(*self._message_header_locator))
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/wait.py", line 122, in until
rv = condition(self.marionette)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/expected.py", line 44, in __call__
return _find(marionette, self.locator)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/expected.py", line 289, in _find
el = func(marionette)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/expected.py", line 41, in <lambda>
self.locator = lambda m: m.find_element(*args)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/marionette.py", line 1589, in find_element
response = self._send_message('findElement', 'value', **kwargs)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/decorators.py", line 36, in _
return func(*args, **kwargs)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/marionette.py", line 691, in _send_message
response = self.client.send(message)
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_transport-0.5-py2.7.egg/marionette_transport/transport.py", line 117, in send
response = self.receive()
File "/var/jenkins/1/workspace/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/.env/local/lib/python2.7/site-packages/marionette_transport-0.5-py2.7.egg/marionette_transport/transport.py", line 73, in receive
    raise IOError(self.connection_lost_msg)
IOError: Connection to Marionette server is lost. Check gecko.log (desktop firefox) or logcat (b2g) for errors.
I haven't seen this failure myself, but I got a marionette timeout exception while waiting on:
self.apps.switch_to_displayed_app()
inside wait_for_done:
http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/contacts/regions/contact_form.py#232

This is happening, because this line:
             Wait(self.marionette).until(lambda m: self.apps.displayed_app.name != Contacts.name)
is always true for this test, because we're coming from the Communications app, then ending in the Messaging app. (tested this by using various print(self.apps.displayed_app.name) statements)

I think this wait_for_done tries to do a bit too much for different consumers, perhaps.
The same is actually happening with test_dialer_add_contact.py, the only other test that makes use of tap_done(return_contacts=False)
Comment on attachment 8642059 [details] [review]
[gaia] mwargers:1189824 > mozilla-b2g:master

Both test_dialer_add_contact.py and test_add_to_new_contact_from_messages.py come from Communications, so that's why this is working. Those are the only 2 tests that do this wait_for_done(return_contacts=False) thing.
Attachment #8642059 - Flags: review?(npark)
Attachment #8642059 - Flags: review?(jlorenzo)
Comment on attachment 8642059 [details] [review]
[gaia] mwargers:1189824 > mozilla-b2g:master

LGTM
Attachment #8642059 - Flags: review?(npark) → review+
Nice catch! We also use the same kind of wait at [1]. Do you think this condition is also always true?

[1] https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/apps/contacts/regions/contact_form.py#L230
(In reply to Johan Lorenzo [:jlorenzo] (QA) from comment #6)
> Nice catch! We also use the same kind of wait at [1]. Do you think this
> condition is also always true?

Yes, that's why I'm changing it in the pull request. In general, this kind of negative testing is kind of dangerous, because it might pass for the wrong reason, as demonstrated here.

In the future, we want to change this to use origin, see bug 1188926.
Comment on attachment 8642059 [details] [review]
[gaia] mwargers:1189824 > mozilla-b2g:master

You're right about the negative tests. The patch looks good to me.
Attachment #8642059 - Flags: review?(jlorenzo) → review+
Thanks for the review Johan! (I know how busy you were)
Merged: https://github.com/mozilla-b2g/gaia/commit/955cc33877a66397dc5c7afbdb1ce63d24fab5c8
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: