The test: autopilot.tests.functional.test_introspection_features.IntrospectionFeatureTests.test_window_geometry is borked

Bug #1267257 reported by Christopher Lee
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autopilot
Fix Released
Critical
Christopher Lee

Bug Description

The test autopilot.tests.functional.test_introspection_features.IntrospectionFeatureTests.test_window_geometry fails with a message similar to:

 Tests running...
======================================================================
FAIL: autopilot.tests.functional.test_introspection_features.IntrospectionFeatureTests.test_window_geometry
----------------------------------------------------------------------
Empty attachments:
  process-stdout

process-return-code: {{{-15}}}
process-stderr: {{{Testability driver loaded. Wire protocol version is "1.4".}}}

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/autopilot/tests/functional/test_introspection_features.py", line 200, in test_window_geometry
    self.assertThat(geom[1], GreaterThan(-1))
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 412, in assertThat
    raise MismatchError(matchee, matcher, mismatch, verbose)
MismatchError: -1 is not < -1871

(the -1 can be a different value depending on your monitor setup).

To reproduce: have autopilot installed and run the command:
  $ autopilot run autopilot.tests.functional.test_introspection_features.IntrospectionFeatureTests.test_window_geometry

Changed in autopilot:
importance: Undecided → Critical
status: New → Triaged
assignee: nobody → Christopher Lee (veebers)
Revision history for this message
Martin Pitt (pitti) wrote :

I tried that with a single monitor, and with two monitors side by side (either primary at the left or right), and two monitors on top of each other, and it always works for me. But if that doesn't work, I suggest replacing

                self.assertThat(geom[0], GreaterThan(-1)) # no GreaterEquals
                self.assertThat(geom[1], GreaterThan(-1))
                self.assertThat(geom[2], LessThan(swidth + 1))
                self.assertThat(geom[3], LessThan(sheight + 1))

with something less strict. This test was originally written for bug 1258170 as tryign to get the window geometry wasn't working at all and caused crashes, but I thought some plausibility tests couldn't hurt.

Why would a window geometry be negative, or the test window appear partially on two different screens? That would sound odd and like a window manager bug. But if these values make some actual sense, I suggest the test could be changed to merely assert that isinstance(geom[0], int) or something similar.

Revision history for this message
Christopher Lee (veebers) wrote :

The issue with the test was resolved way back at revno 430. Marked as such.

Changed in autopilot:
status: Triaged → 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.