← Back to team overview

launchpad-dev team mailing list archive

Re: LayerIsolationError

 

This is very odd; the code in question passed ec2test in order to land at all.

ZopelessLayer raises NotImplementedError
because of that, the librarian doesn't get torn down *at all*.

What may be happening is that zope is helpfully nondeterministic about
layer teardown order (e.g. it may be dictionary order, or MRO order
and that may be dictionary order).

We need to make the order deterministic, if that is it.

That said, I don't think LibrarianLayer.tearDown() gains anything by
calling _check_and_reset(), so this patch might be a good immediate
stopgap. Can someone seeing this (especially anyone with a local,
fast-trigger example) try it?


=== modified file 'lib/canonical/testing/layers.py'
--- lib/canonical/testing/layers.py	2010-10-04 06:20:04 +0000
+++ lib/canonical/testing/layers.py	2010-10-05 06:59:35 +0000
@@ -589,7 +589,7 @@
                     "_reset_between_tests not reset before LibrarianLayer "
                     "shutdown"
                     )
-        LibrarianLayer._check_and_reset()
+        LibrarianTestSetup().clear()
         LibrarianTestSetup().tearDown()

     @classmethod



Follow ups

References