Autopilot emulator can loop infinitely while searching for tab

Bug #1211619 reported by Nicholas Skaggs
6
This bug affects 1 person
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_to_tab_by_index(self, index):
        """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_number_of_tabs():
            raise IndexError('Tab index out of range.')
        current_tab = tabs.get_current_tab()
        while not tabs.selectedTabIndex == index:
            current_tab = self.switch_to_next_tab()
        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

Revision history for this message
Martin Borho (martin-borho) wrote :

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.

Leo Arias (elopio)
Changed in ubuntu-ui-toolkit:
status: New → In Progress
assignee: nobody → Leo Arias (elopio)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:ubuntu-ui-toolkit at revision None, scheduled for release in ubuntu-ui-toolkit, milestone Unknown

Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-ui-toolkit - 0.1.46+13.10.20130815.1-0ubuntu1

---------------
ubuntu-ui-toolkit (0.1.46+13.10.20130815.1-0ubuntu1) saucy; urgency=low

  [ Leo Arias ]
  * Added a safeguard to prevent the tabs autopilot emulator to loop for
    ever. (LP: #1211619)

  [ tpeeters ]
  * Fix bug 1209403 where Tabs header does not become invisible when
    another page is pushed on the PageStack and a gradient background is
    used. (LP: #1209403)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 695
 -- Ubuntu daily release <email address hidden> Thu, 15 Aug 2013 06:33:50 +0000

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Fix Released
Changed in ubuntu-ui-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.