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

RESOLVED FIXED

Status

Firefox OS
Gaia::UI Tests
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Martijn Wargers (zombie), Assigned: Martijn Wargers (zombie))

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Assignee)

Description

3 years ago
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.
(Assignee)

Comment 1

3 years ago
Ok, bug 1188924 is now checked in, so we should make use of that here.
Depends on: 1188924
(Assignee)

Comment 2

3 years ago
(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.
(Assignee)

Comment 4

3 years ago
Note that if these places make use of the system app, then it's no problem, because the system app is never closed.
(Assignee)

Comment 5

3 years ago
Created attachment 8651548 [details] [diff] [review]
all.diff

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.
Created attachment 8651551 [details] [review]
[gaia] mwargers:1195033 > mozilla-b2g:master
(Assignee)

Comment 7

3 years ago
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+
(Assignee)

Comment 10

3 years ago
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
Last Resolved: 3 years ago
Resolution: --- → FIXED
(Assignee)

Updated

3 years ago
Depends on: 1199597
You need to log in before you can comment on or make changes to this bug.