Autopilot emulator can loop infinitely while searching for tab
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Fix Released
|
Undecided
|
Leo Arias | ||
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The autopilot emulator need sto make sure we don't have open ended loops in tab switching.
def switch_
"""Open a tab.
:parameter index: The index of the tab to open.
:return: The newly opened tab.
"""
tabs = self.get_tabs()
if index >= tabs.get_
raise IndexError('Tab index out of range.')
current_tab = tabs.get_
while not tabs.selectedTa
return current_tab
Let's add a controlled exit once we've checked every tab and fail to exit the loop. I've NO idea why or how we could not find the tabIndex, but it's happening in the weather app smoke tests at present, and in general this has potential to loop.
Related branches
- PS Jenkins bot: Approve (continuous-integration)
- Nicholas Skaggs (community): Approve
- Ubuntu SDK team: Pending requested
-
Diff: 35 lines (+13/-1)1 file modifiedtests/autopilot/ubuntuuitoolkit/emulators.py (+13/-1)
Changed in ubuntu-ui-toolkit: | |
status: | New → In Progress |
assignee: | nobody → Leo Arias (elopio) |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
I've stumbled about this bug once, as I've tried to move from the last tab to the next/first tab. As the first tab is always attached at the end of the tabs in the tabs navigation. They are in an endless loop, so to say.