Merge lp:~mikemc/ubuntuone-client/accelerate-nirvana into lp:ubuntuone-client

Proposed by Mike McCracken
Status: Merged
Approved by: dobey
Approved revision: 1374
Merged at revision: 1369
Proposed branch: lp:~mikemc/ubuntuone-client/accelerate-nirvana
Merge into: lp:ubuntuone-client
Prerequisite: lp:~mikemc/ubuntuone-client/clean-up-fsmonitor-in-tests
Diff against target: 12 lines (+1/-1)
1 file modified
tests/platform/test_tools.py (+1/-1)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-client/accelerate-nirvana
Reviewer Review Type Date Requested Status
dobey (community) Approve
Review via email: mp+142814@code.launchpad.net

Commit message

- Speed up many tests by waiting less time for nothing to happen.

Description of the change

- Speed up many tests by waiting less time for nothing to happen.

TestToolsBase ends its setUp with a call to main.wait_for_nirvana() to guarantee that the event queue is in a known empty state before each test starts. Because the event queue is always empty at this point, we don't really need to wait any real time (just need to wait for other code to set the state), and the default min wait time of 0.5 seconds is way too long.

Reducing this to 0.001 cut execution time of test_tools.py on my laptop by a factor of 7.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/platform/test_tools.py'
2--- tests/platform/test_tools.py 2013-01-10 23:31:21 +0000
3+++ tests/platform/test_tools.py 2013-01-10 23:31:21 +0000
4@@ -78,7 +78,7 @@
5
6 self.patch(tools, 'is_already_running',
7 lambda bus: defer.succeed(True))
8- yield self.main.wait_for_nirvana()
9+ yield self.main.wait_for_nirvana(last_event_interval=0.001)
10
11 def _create_share(self, accepted=True, subscribed=True):
12 """Return a newly created Share."""

Subscribers

People subscribed via source and target branches