Merge lp:~jtv/maas/clearer-spurious-error into lp:~maas-committers/maas/trunk

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 2697
Proposed branch: lp:~jtv/maas/clearer-spurious-error
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 19 lines (+5/-2)
1 file modified
src/maasserver/testing/eventloop.py (+5/-2)
To merge this branch: bzr merge lp:~jtv/maas/clearer-spurious-error
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Julian Edwards (community) Approve
Review via email: mp+230761@code.launchpad.net

Commit message

Slightly more helpful detailed message to help diagnose test failures like in bug 1356788.

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

 review: approve

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

Your comment from bug 1356788:

  If I make the code go into pdb at the point where it is about to raise
  the exception, and I look into loop.services interactively, I get a
  MultiService object representing an empty list of services. So
  presumably this is a race that will fix itself given time.

was the thing that helped me understand what I'd done wrong. The list of
services was basically irrelevant because RegionEventLoopFixture always
sets up the same set of services.

So, approved because it's fine, but it's actually not particularly
useful information, and for bug 1356788 was a red herring at first.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/testing/eventloop.py'
2--- src/maasserver/testing/eventloop.py 2014-08-12 21:15:25 +0000
3+++ src/maasserver/testing/eventloop.py 2014-08-14 09:28:26 +0000
4@@ -45,10 +45,13 @@
5 "The event-loop has been left running; this fixture cannot "
6 "make a reasonable decision about what to do next.")
7 # Don't proceed if any services are registered.
8- if list(loop.services) != []:
9+ services = list(loop.services)
10+ if services != []:
11 raise RuntimeError(
12 "One or more services are registered; this fixture cannot "
13- "make a reasonable decision about what to do next.")
14+ "make a reasonable decision about what to do next. "
15+ "The services are: %s."
16+ % ', '.join(service.name for service in services))
17
18 def setUp(self):
19 super(RegionEventLoopFixture, self).setUp()