Merge lp:~dobey/ubuntuone-client/fix-dbus-testing into lp:ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 831
Merged at revision: 830
Proposed branch: lp:~dobey/ubuntuone-client/fix-dbus-testing
Merge into: lp:ubuntuone-client
Diff against target: 60 lines (+4/-21)
1 file modified
tests/platform/linux/test_dbus.py (+4/-21)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/fix-dbus-testing
Reviewer Review Type Date Requested Status
Facundo Batista (community) Approve
Natalia Bidart (community) Approve
Review via email: mp+48239@code.launchpad.net

Commit message

Inherit from the devtools DBusTestCase as well as BaseTwistedTestCase to ensure the dbus runner gets run

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

It works, yey!

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Hum, is failing for some particular tests with:

  File "/home/nessita/canonical/u1/client/share-subscribe-dbus/tests/platform/linux/test_dbus.py", line 158, in <lambda>
    d.addBoth(lambda _: DBusTestCase.tearDown(self))
  File "/usr/lib/pymodules/python2.6/ubuntuone/devtools/testcase.py", line 230, in tearDown
    d = self.cleanup_signal_receivers(self.signal_receivers)
  File "/home/nessita/canonical/u1/client/share-subscribe-dbus/tests/platform/linux/test_dbus.py", line 194, in cleanup_signal_receivers
    (str(match),), callback, self.error_handler)
  File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 585, in call_async
    require_main_loop=require_main_loop)
dbus.exceptions.DBusException: Connection is disconnected - unable to make method call

review: Needs Fixing
Revision history for this message
Facundo Batista (facundo) wrote :

Had 49 errors like the following:

===============================================================================
[ERROR]: tests.platform.linux.test_dbus.ShareTests.test_delete_share_from_me_error

Traceback (most recent call last):
  File "/home/facundo/canonical/u1-client/all-pushing-kwargs-6/tests/platform/linux/test_dbus.py", line 158, in <lambda>
    d.addBoth(lambda _: DBusTestCase.tearDown(self))
  File "/usr/lib/pymodules/python2.6/ubuntuone/devtools/testcase.py", line 230, in tearDown
    d = self.cleanup_signal_receivers(self.signal_receivers)
  File "/home/facundo/canonical/u1-client/all-pushing-kwargs-6/tests/platform/linux/test_dbus.py", line 194, in cleanup_signal_receivers
    (str(match),), callback, self.error_handler)
  File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 585, in call_async
    require_main_loop=require_main_loop)
dbus.exceptions.DBusException: Connection is disconnected - unable to make method call

review: Needs Fixing
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Works now.

review: Approve
Revision history for this message
Facundo Batista (facundo) wrote :

Now it works ok!

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (181.5 KiB)

The attempt to merge lp:~dobey/ubuntuone-client/fix-dbus-testing into lp:ubuntuone-client failed. Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
(B testing autoconf2.50... not found.
  testing autoconf... found 2.67
checking for automake >= 1.10...
(B testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
(B testing libtoolize... found 2.2.6b
checking for intltool >= 0.30...
(B testing intltoolize... found 0.41.0
checking for pkg-config >= 0.14.0...
(B testing pkg-config... found 0.25
checking for gtk-doc >= 1.0...
(B testing gtkdocize... found 1.16
Checking for required M4 macros...
(BChecking for forbidden M4 macros...
(BProcessing ./configure.ac
(BRunning libtoolize...
(Blibtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
Running intltoolize...
(BRunning gtkdocize...
(BRunning aclocal-1.11...
(BRunning autoconf...
(BRunning autoheader...
(BRunning automake-1.11...
(BRunning ./configure --enable-gtk-doc --enable-debug ...
(Bchecking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whethe...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/platform/linux/test_dbus.py'
2--- tests/platform/linux/test_dbus.py 2011-01-24 15:57:34 +0000
3+++ tests/platform/linux/test_dbus.py 2011-02-01 21:59:25 +0000
4@@ -62,6 +62,7 @@
5 from ubuntuone.syncdaemon.marker import MDMarker
6
7 from ubuntuone.devtools.handlers import MementoHandler
8+from ubuntuone.devtools.testcase import DBusTestCase
9
10
11 # OAuth stubs
12@@ -110,11 +111,12 @@
13 return FAKED_CREDENTIALS
14
15
16-class DBusTwistedTestCase(BaseTwistedTestCase):
17+class DBusTwistedTestCase(DBusTestCase, BaseTwistedTestCase):
18 """ Test the DBus event handling """
19
20 def setUp(self):
21 """ Setup the infrastructure fo the test (dbus service). """
22+ DBusTestCase.setUp(self)
23 BaseTwistedTestCase.setUp(self)
24 self.log = logging.getLogger("ubuntuone.SyncDaemon.TEST")
25 self.log.info("starting test %s.%s", self.__class__.__name__,
26@@ -150,7 +152,7 @@
27
28 def tearDown(self):
29 """ Cleanup the test. """
30- d = self.cleanup_signal_receivers(self.signal_receivers)
31+ d = DBusTestCase.tearDown(self)
32 d.addBoth(self._tearDown)
33 d.addBoth(lambda _: BaseTwistedTestCase.tearDown(self))
34 return d
35@@ -176,25 +178,6 @@
36 else:
37 self.fail(str(error))
38
39- def cleanup_signal_receivers(self, signal_receivers):
40- """ cleanup self.signal_receivers and returns a deferred """
41- deferreds = []
42- for match in signal_receivers:
43- d = defer.Deferred()
44- def callback(*args):
45- """ callback that accepts *args. """
46- if not d.called:
47- d.callback(args)
48- self.bus.call_async(dbus.bus.BUS_DAEMON_NAME,
49- dbus.bus.BUS_DAEMON_PATH,
50- dbus.bus.BUS_DAEMON_IFACE, 'RemoveMatch', 's',
51- (str(match),), callback, self.error_handler)
52- deferreds.append(d)
53- if deferreds:
54- return defer.DeferredList(deferreds)
55- else:
56- return defer.succeed(True)
57-
58
59 class FakeLogin(SSOCredentials):
60 """Stub Object which listens for D-Bus OAuth requests"""

Subscribers

People subscribed via source and target branches