bamf matches the wrong desktop file when process started via autostart

Bug #1193502 reported by Francis Ginther
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
BAMF
Fix Released
High
Marco Trevisan (Treviño)
bamf (Ubuntu)
Fix Released
Undecided
Marco Trevisan (Treviño)

Bug Description

This was found during testing of the autopilot suite during daily-release testing (for some reason these test results are not being published). Found when using bamf: 0.5.0daily13.06.19-0ubuntu1. Earlier version did not show this issue.

The failing test is:
autopilot.tests.functional.test_process_emulator.ProcessEmulatorTests.test_wait_for_app_running_works

[Test Log:]
Stacktrace

_StringException: test-log: {{{
00:25:02.548 INFO globals:48 - ************************************************************
00:25:02.549 INFO globals:49 - Starting test autopilot.tests.functional.test_process_emulator.ProcessEmulatorTests.test_wait_for_app_running_works
00:25:02.550 DEBUG globals:131 - Starting: ['/usr/bin/recordmydesktop', '--no-sound', '--no-frame', '-o', '/var/local/autopilot//videos/autopilot.tests.functional.test_process_emulator.ProcessEmulatorTests.test_wait_for_app_running_works.ogv']
}}}

traceback-1: {{{
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autopilot/testcase.py", line 276, in _compare_system_with_app_snapshot
    raise AssertionError("The following apps were started during the test and not closed: %r", new_apps)
AssertionError: ('The following apps were started during the test and not closed: %r', [<Application 'Fire-up Autopilot tests'>])
}}}

traceback-2: {{{
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autopilot/utilities.py", line 253, in action_on_test_end
    obj.on_test_end(test_instance)
TypeError: on_test_end() takes no arguments (2 given)
}}}

traceback-3: {{{
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autopilot/utilities.py", line 253, in action_on_test_end
    obj.on_test_end(test_instance)
TypeError: on_test_end() takes no arguments (2 given)
}}}

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autopilot/tests/functional/test_process_emulator.py", line 56, in test_wait_for_app_running_works
    self.assertThat(ret, Equals(True))
MismatchError: True != False

[Analysis]
The test attempts to open gedit and then, through dbus, assert that a process was started that matches the desktop file 'gedit.desktop'. This fails because bamf returns a match to /etc/xdg/autostart/autopilot.desktop (this file contains "Fire-up Autopilot Tests"). Running the test without this process does not reproduce this issue.

[Steps to reproduce]
The files used here were extracted from lp:otto and modified to run the single failing test case.
 - Copy autopilot.desktop to /etc/xdg/autostart/autopilot.desktop
 - Copy run-autopilot.sh to /usr/local/bin/run-autopilot.sh
 - mkdir -p /var/local/autopilot
 - Copy testsuites to /var/local/autopilot
 - log out/log in.
 - remove $HOME/.ap_setup_done to retest
The test will run and open a gedit window with the wrong application title.

I can reliable reproduce this on my saucy i386 VM. I've been unable to reproduce on my laptop running saucy amd64. The issue is that the xdg autostart job never appears to run.

Related branches

Revision history for this message
Francis Ginther (fginther) wrote :
Revision history for this message
Francis Ginther (fginther) wrote :
Revision history for this message
Francis Ginther (fginther) wrote :
description: updated
Changed in bamf:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
milestone: none → 0.5.0
Revision history for this message
Francis Ginther (fginther) wrote :

I've successfully tested the fix on my saucy i386 VM.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:bamf at revision 558, scheduled for release in bamf, milestone 0.5.0

Changed in bamf:
status: In Progress → Fix Committed
Changed in bamf (Ubuntu):
status: New → Fix Committed
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bamf - 0.5.0+13.10.20130628-0ubuntu1

---------------
bamf (0.5.0+13.10.20130628-0ubuntu1) saucy; urgency=low

  [ Marco Trevisan (Treviño) ]
  * BamfDaemon, LibBamf: Make the BamfView's name a property, deprecated
    method+signal.
  * BamfDaemon, LibBamf: add icon property to store the BamfView icon
    and notify about its changes. New tests added.
  * BamfMatcher: ignore registered .desktop files that are in an
    autostart-folder. (LP: #1193502)
  * BamfApplication: try to use a window icon if the computed icon
    belongs to a "generic" app Added a bunch of new BamfApplication
    tests for icon. (LP: #768931, #1007383)
  * BamfFactory: remove the local_views list, we don't need that anymore
    Having them tracked on allocated_views list is enough, and fixes an
    issue as explained on bug #1193559. (LP: #1193449, #1193559)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 560
 -- Ubuntu daily release <email address hidden> Fri, 28 Jun 2013 02:02:32 +0000

Changed in bamf (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Fix Released in Bamf BAMF 0.5.0.

Changed in bamf:
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.