Merge lp:~mikemc/ubuntuone-client/fix-signal-exceptions into lp:ubuntuone-client

Proposed by Mike McCracken on 2012-09-06
Status: Merged
Approved by: dobey on 2012-09-07
Approved revision: 1308
Merged at revision: 1307
Proposed branch: lp:~mikemc/ubuntuone-client/fix-signal-exceptions
Merge into: lp:ubuntuone-client
Diff against target: 105 lines (+40/-6)
3 files modified
tests/platform/ipc/test_perspective_broker.py (+26/-0)
ubuntuone/platform/ipc/ipc_client.py (+12/-4)
ubuntuone/platform/ipc/perspective_broker.py (+2/-2)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-client/fix-signal-exceptions
Reviewer Review Type Date Requested Status
dobey (community) Approve on 2012-09-07
Roberto Alsina (community) 2012-09-06 Approve on 2012-09-07
Review via email: mp+123189@code.launchpad.net

Commit Message

- Fix twisted IPC exceptions for syncdaemon status signals. (LP: #902189)

Description of the Change

- Fix twisted IPC exceptions for syncdaemon status signals. (LP: #902189)

Added a test in tests/platform/ipc/test_perspective_broker.py to check method signature matches for ipc_client endpoints.
This reproduces the error seen when on_download_finished raises a TypeError on windows in the bug, and now on mac also.

Fixed several bugs that that test revealed:
- arg signatures for on_{down/up}load_{finished/file_progress}
- missing ipc_client endpoints for RequestQueueAdded and RequestQueueRemoved

All tests pass on linux.

Test pass on macos if you just run the changed tests:
% ./run-mac-tests tests/platform/ipc/

Tested IRL on mac by uploading to web interface and noticing no annoying errors when syncdaemon downloaded it, just this:
2012-09-06 15:37:32,191 - ubuntuone.SyncDaemon.Pb - DEBUG - emitting 'on_download_finished' to all (1) connected clients.

To post a comment you must log in.
Roberto Alsina (ralsina) wrote :

YES!

review: Approve
dobey (dobey) :
review: Approve
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (263.4 KiB)

The attempt to merge lp:~mikemc/ubuntuone-client/fix-signal-exceptions into lp:ubuntuone-client failed. Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
  testing autoconf2.50... not found.
  testing autoconf... found 2.69
checking for automake >= 1.10...
  testing automake-1.12... not found.
  testing automake-1.11... found 1.11.5
checking for libtool >= 1.5...
  testing libtoolize... found 2.4.2
checking for intltool >= 0.30...
  testing intltoolize... found 0.50.2
checking for pkg-config >= 0.14.0...
  testing pkg-config... found 0.26
checking for gtk-doc >= 1.0...
  testing gtkdocize... found 1.18
Checking for required M4 macros...
Checking for forbidden M4 macros...
Processing ./configure.ac
Running libtoolize...
libtoolize: 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...
Running gtkdocize...
Running aclocal-1.11...
Running autoconf...
Running autoheader...
Running automake-1.11...
Running ./configure --enable-gtk-doc --enable-debug ...
checking 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... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... 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... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
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 s...

Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (263.4 KiB)

The attempt to merge lp:~mikemc/ubuntuone-client/fix-signal-exceptions into lp:ubuntuone-client failed. Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
  testing autoconf2.50... not found.
  testing autoconf... found 2.69
checking for automake >= 1.10...
  testing automake-1.12... not found.
  testing automake-1.11... found 1.11.5
checking for libtool >= 1.5...
  testing libtoolize... found 2.4.2
checking for intltool >= 0.30...
  testing intltoolize... found 0.50.2
checking for pkg-config >= 0.14.0...
  testing pkg-config... found 0.26
checking for gtk-doc >= 1.0...
  testing gtkdocize... found 1.18
Checking for required M4 macros...
Checking for forbidden M4 macros...
Processing ./configure.ac
Running libtoolize...
libtoolize: 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...
Running gtkdocize...
Running aclocal-1.11...
Running autoconf...
Running autoheader...
Running automake-1.11...
Running ./configure --enable-gtk-doc --enable-debug ...
checking 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... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... 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... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
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 s...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/platform/ipc/test_perspective_broker.py'
2--- tests/platform/ipc/test_perspective_broker.py 2012-08-29 12:37:23 +0000
3+++ tests/platform/ipc/test_perspective_broker.py 2012-09-06 22:52:21 +0000
4@@ -500,6 +500,32 @@
5 for signal_name, args in self.signal_mapping:
6 self.assert_remote_signal(signal_name, *args)
7
8+ def test_remote_signal_calling(self):
9+ """Call client functions directly, test for TypeErrors."""
10+ if self.client_name is None:
11+ return
12+
13+ def fake_remote_cb(*args, **kwargs):
14+ return (args, kwargs)
15+
16+ client = getattr(self, self.client_name)
17+ remote_client = self.client_class(FakeRemoteObject())
18+ for signal_name, args in self.signal_mapping:
19+
20+ remote_client_func_name = client.signal_mapping[signal_name]
21+ remote_cb_name = "%s_cb" % remote_client_func_name
22+ setattr(remote_client, remote_cb_name, fake_remote_cb)
23+ self.addCleanup(delattr, remote_client, remote_cb_name)
24+
25+ remote_client_func = getattr(remote_client,
26+ remote_client_func_name)
27+
28+ result = remote_client_func(*args)
29+
30+ # add empty kwargs because signal wrapper will add them:
31+ expected = (args, {})
32+ self.assertEqual(expected, result)
33+
34
35 class StatusTestCase(IPCTestCase):
36 """Test the status client class."""
37
38=== modified file 'ubuntuone/platform/ipc/ipc_client.py'
39--- ubuntuone/platform/ipc/ipc_client.py 2012-08-29 09:07:32 +0000
40+++ ubuntuone/platform/ipc/ipc_client.py 2012-09-06 22:52:21 +0000
41@@ -234,11 +234,11 @@
42 """Emit DownloadStarted."""
43
44 @signal
45- def on_download_file_progress(self, download, **info):
46+ def on_download_file_progress(self, download, info):
47 """Emit DownloadFileProgress."""
48
49 @signal
50- def on_download_finished(self, download, **info):
51+ def on_download_finished(self, download, info):
52 """Emit DownloadFinished."""
53
54 @signal
55@@ -246,11 +246,11 @@
56 """Emit UploadStarted."""
57
58 @signal
59- def on_upload_file_progress(self, upload, **info):
60+ def on_upload_file_progress(self, upload, info):
61 """Emit UploadFileProgress."""
62
63 @signal
64- def on_upload_finished(self, upload, *info):
65+ def on_upload_finished(self, upload, info):
66 """Emit UploadFinished."""
67
68 @signal
69@@ -261,6 +261,14 @@
70 def on_metaqueue_changed(self):
71 """Emit MetaQueueChanged."""
72
73+ @signal
74+ def on_request_queue_added(self, op_name, op_id, data):
75+ """Emit RequestQueueAdded."""
76+
77+ @signal
78+ def on_request_queue_removed(self, op_name, op_id, data):
79+ """Emit RequestQueueRemoved."""
80+
81
82 class EventsClient(RemoteClient, Referenceable):
83 """Client use to access the status api."""
84
85=== modified file 'ubuntuone/platform/ipc/perspective_broker.py'
86--- ubuntuone/platform/ipc/perspective_broker.py 2012-08-16 12:00:12 +0000
87+++ ubuntuone/platform/ipc/perspective_broker.py 2012-09-06 22:52:21 +0000
88@@ -305,7 +305,7 @@
89 """Fire a signal to notify about a download progress."""
90
91 @signal
92- def DownloadFinished(self, path, *info):
93+ def DownloadFinished(self, path, info):
94 """Fire a signal to notify that a download has finished."""
95
96 @signal
97@@ -317,7 +317,7 @@
98 """Fire a signal to notify about an upload progress."""
99
100 @signal
101- def UploadFinished(self, path, *info):
102+ def UploadFinished(self, path, info):
103 """Fire a signal to notify that an upload has finished."""
104
105 @signal

Subscribers

People subscribed via source and target branches