← Back to team overview

maas-devel team mailing list archive

Re: Spurious test failure

 

On 2014-05-20 04:14, Julian Edwards wrote:
Anyone else seen this?

======================================================================
FAIL:
maasserver.rpc.tests.test_regionservice.TestRegionAdvertisingService.test_prepare_holds_startup_lock
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
   File
"/tmp/tarmac/branch.ymB3aW/src/maasserver/rpc/tests/test_regionservice.py",
line 667, in test_prepare_holds_startup_lock
     self.assertFalse(locks.eventloop.is_locked())
   File "/usr/lib/python2.7/unittest/case.py", line 418, in assertFalse
     raise self.failureException(msg)
AssertionError: True is not false

This happened on the lander just now.  Retrying the branch made it land OK.

The problem is in line 666: prepare() is called, but doesn't seem to complete before returning. So it must still be in the event loop, right?

This is total guesswork, but could the problem be that the prepare() method has a decorator to make it synchronous, _followed by_ decorators that make it wait for locks? Given how decorators wrap functions, wouldn't that mean something like “this method shouldn't leave anything on the event loop, but before you even go into it, leave it on the event loop until these locks are available”?

Of course that raises the question why the locks might not be available, but perhaps that's just another test running asynchronously without us realising it.


Jeroen


References