Closed Bug 1195033 Opened 9 years ago Closed 9 years ago

tap_update(self, return_details=False) is not safe, needs workaround for bug 1109213

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

(2 files)

See:
http://mxr.mozilla.org/gaia/search?string=.tap_update%28
http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/contacts/regions/contact_form.py#149

In the case of return_details=False, tap_update is not safe. When I add a time.sleep(1) call after line 163, I get errors like in bug 1109213.
That's it not causing not any troubles currently is only luck, I guess.
Ok, bug 1188924 is now checked in, so we should make use of that here.
Depends on: 1188924
(In reply to Martijn Wargers [:mwargers] (QA) from comment #0)
> In the case of return_details=False, tap_update is not safe. When I add a
> time.sleep(1) call after line 163, I get errors like in bug 1109213.
> That's it not causing not any troubles currently is only luck, I guess.

Ok, that it's not failing constantly, is because of the self.apps.displayed_app part, that one is switching to the system frame: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/gaia_test.py#111
If you directly move back to the system app (or other app that keeps to be open), then you won't get this error.
But I don't think this is a good situation, currently.
Note that if these places make use of the system app, then it's no problem, because the system app is never closed.
Attached patch all.diffSplinter Review
I did some testing with the methods that seemed susceptible to this problem.
With this patch, I was able to reproduce problems in these:


http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/wallpaper/app.py#21
test_settings_wallpaper.py

http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/homescreen/regions/bookmark_menu.py#35
test_browser_bookmark.py
test_rocketbar_add_collection_save_bookmark.py

http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/contacts/app.py#159
test_sms_add_contact.py 

I didn't get a problem with this one:
http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/contacts/regions/contact_form.py#164
/test_add_to_an_existing_contact_from_messages.py 

tap_back_button usage:
http://mxr.mozilla.org/gaia/search?string=tap_back_button
This one I can't test locally:
http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/gallery/regions/view_image.py#43
test_sms_with_picture_attached.py
The browser one isn't closing an app at all.
The other tap_back_button functions don't seem to be used at all.
Comment on attachment 8651551 [details] [review]
[gaia] mwargers:1195033 > mozilla-b2g:master

Ok, these places need it.
Attachment #8651551 - Flags: review?(npark)
Attachment #8651551 - Flags: review?(jlorenzo)
Comment on attachment 8651551 [details] [review]
[gaia] mwargers:1195033 > mozilla-b2g:master

LGTM
Attachment #8651551 - Flags: review?(jlorenzo) → review+
Comment on attachment 8651551 [details] [review]
[gaia] mwargers:1195033 > mozilla-b2g:master

Aha, so this is how I should handle NoSuchWindows exception. thanks!
Attachment #8651551 - Flags: review?(npark) → review+
Merged: https://github.com/mozilla-b2g/gaia/commit/6a84d5542d34b7a414062750cf022e5b576fc0a0

I guess we should mention bug 1164078 in the centralized workaround. That is currently the bug covering this NoSuchWindow exception.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Depends on: 1199597
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: