Merge lp:~alecu/ubuntuone-client/zero-steps into lp:ubuntuone-client

Proposed by Alejandro J. Cura
Status: Merged
Approved by: dobey
Approved revision: 954
Merged at revision: 957
Proposed branch: lp:~alecu/ubuntuone-client/zero-steps
Merge into: lp:ubuntuone-client
Diff against target: 78 lines (+34/-2)
2 files modified
tests/status/test_aggregator.py (+29/-0)
ubuntuone/status/aggregator.py (+5/-2)
To merge this branch: bzr merge lp:~alecu/ubuntuone-client/zero-steps
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
dobey (community) Approve
Review via email: mp+57392@code.launchpad.net

Commit message

Queue Done timer is now stopped and cleaned up when new downloads/uploads are queued (LP: #759084)

Description of the change

Queue Done timer is now stopped and cleaned up when new downloads/uploads are queued (LP: #759084)

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

Looks good!

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

The attempt to merge lp:~alecu/ubuntuone-client/zero-steps 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.67
checking for automake >= 1.10...
  testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
  testing libtoolize... found 2.2.6b
checking for intltool >= 0.30...
  testing intltoolize... found 0.41.1
checking for pkg-config >= 0.14.0...
  testing pkg-config... found 0.25
checking for gtk-doc >= 1.0...
  testing gtkdocize... found 1.16
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... 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 whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries.....

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/status/test_aggregator.py'
2--- tests/status/test_aggregator.py 2011-04-07 15:53:31 +0000
3+++ tests/status/test_aggregator.py 2011-04-12 20:45:29 +0000
4@@ -1202,6 +1202,7 @@
5 self.assertEqual(self.aggregator.done_counter, 0)
6 self.assertEqual(len(self.aggregator.files_uploading), 0)
7 self.assertEqual(len(self.aggregator.files_downloading), 0)
8+ self.assertIs(self.aggregator.queue_done_timer, None)
9
10 def assertMiscCommandQueued(self, fc):
11 """Assert that some command was queued."""
12@@ -1375,6 +1376,34 @@
13 self.assertEqual(0.0, self.aggregator.progress_bar.progress)
14 self.assertFalse(self.aggregator.progress_bar.visible)
15
16+ def test_download_started_cancels_timer(self):
17+ """Starting a download cancels the queue_done timer."""
18+ fc = FakeCommand()
19+ self.status_frontend.download_started(fc)
20+ self.aggregator.clock.advance(self.aggregator.finished_delay)
21+ self.status_frontend.download_finished(fc)
22+ self.aggregator.queue_done()
23+ self.aggregator.clock.advance(self.aggregator.finished_delay / 2)
24+ fc2 = FakeCommand()
25+ self.status_frontend.download_started(fc2)
26+ self.assertIs(self.aggregator.queue_done_timer, None)
27+ self.aggregator.clock.advance(self.aggregator.finished_delay)
28+ self.status_frontend.download_finished(fc2)
29+
30+ def test_upload_started_cancels_timer(self):
31+ """Starting an upload cancels the queue_done timer."""
32+ fc = FakeCommand()
33+ self.status_frontend.upload_started(fc)
34+ self.aggregator.clock.advance(self.aggregator.finished_delay)
35+ self.status_frontend.upload_finished(fc)
36+ self.aggregator.queue_done()
37+ self.aggregator.clock.advance(self.aggregator.finished_delay / 2)
38+ fc2 = FakeCommand()
39+ self.status_frontend.upload_started(fc2)
40+ self.assertIs(self.aggregator.queue_done_timer, None)
41+ self.aggregator.clock.advance(self.aggregator.finished_delay)
42+ self.status_frontend.upload_finished(fc2)
43+
44
45 class StatusGrouperTestCase(TestCase):
46 """Tests for the group_statuses function."""
47
48=== modified file 'ubuntuone/status/aggregator.py'
49--- ubuntuone/status/aggregator.py 2011-04-07 15:53:31 +0000
50+++ ubuntuone/status/aggregator.py 2011-04-12 20:45:29 +0000
51@@ -645,6 +645,7 @@
52 self.downloading_filename = ''
53 if self.queue_done_timer is not None:
54 self.queue_done_timer.cleanup()
55+ self.queue_done_timer = None
56
57 if self.file_discovery_bubble:
58 self.file_discovery_bubble.cleanup()
59@@ -716,7 +717,8 @@
60 def download_started(self, command):
61 """A download just started."""
62 if self.queue_done_timer is not None:
63- self.queue_done_timer.reset()
64+ self.queue_done_timer.cleanup()
65+ self.queue_done_timer = None
66 self.files_downloading.append(command)
67 self.download_total += 1
68 self.total_counter += 1
69@@ -743,7 +745,8 @@
70 def upload_started(self, command):
71 """An upload just started."""
72 if self.queue_done_timer is not None:
73- self.queue_done_timer.reset()
74+ self.queue_done_timer.cleanup()
75+ self.queue_done_timer = None
76 self.files_uploading.append(command)
77 self.upload_total += 1
78 self.total_counter += 1

Subscribers

People subscribed via source and target branches