← Back to team overview

launchpad-dev team mailing list archive

Re: zope testrunner errors

 

On Sun, Oct 24, 2010 at 9:01 AM, Bryce Harrington <bryce@xxxxxxxxxxxxx> wrote:
> Anyone recognize this error?
>
> This error shows up even on older branches that already landed, so I'm
> suspecting this started after a rocketfuel-get run or some other system
> update, rather than a problem with the tests themselves.


> Running canonical.testing.layers.AppServerLayer tests:
>  Set up canonical.testing.layers.BaseLayer in 0.001 seconds.
>  Set up canonical.testing.layers.DatabaseLayer in 0.274 seconds.
>  Set up canonical.testing.layers.LibrarianLayer in 5.949 seconds.
>  Set up canonical.testing.layers.MemcachedLayer in 0.111 seconds.
>  Set up canonical.testing.layers.LaunchpadLayer in 0.000 seconds.
>  Set up canonical.testing.layers.FunctionalLayer in 4.333 seconds.
>  Set up canonical.testing.layers.LaunchpadFunctionalLayer in 0.000 seconds.
>  Set up canonical.testing.layers.AppServerLayer in 7.231 seconds.
>  Ran 10 tests with 0 failures and 0 errors in 28.529 seconds.
> Running canonical.testing.layers.DatabaseFunctionalLayer tests:
>  Tear down canonical.testing.layers.AppServerLayerNo handlers could be found for logger "lazr.smtptest"
>  in 0.502 seconds.
>  Tear down canonical.testing.layers.LaunchpadFunctionalLayer in 0.119 seconds.
>  Tear down canonical.testing.layers.LaunchpadLayer in 0.000 seconds.
>  Tear down canonical.testing.layers.LibrarianLayer in 0.000 seconds.
>  Tear down canonical.testing.layers.MemcachedLayer in 0.000 seconds.
>  Set up canonical.testing.layers.DatabaseFunctionalLayer in 0.000 seconds.
> Traceback (most recent call last):
>  File "./bin/test", line 275, in <module>
>    testrunner.run([])
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/zope.testing-3.9.4_p1-py2.6.egg/zope/testing/testrunner/__init__.py", line 32, in run
>    failed = run_internal(defaults, args, script_parts=script_parts)
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/zope.testing-3.9.4_p1-py2.6.egg/zope/testing/testrunner/__init__.py", line 45, in run_internal
>    runner.run()
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/zope.testing-3.9.4_p1-py2.6.egg/zope/testing/testrunner/runner.py", line 138, in run
>    self.run_tests()
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/zope.testing-3.9.4_p1-py2.6.egg/zope/testing/testrunner/runner.py", line 219, in run_tests
>    setup_layers, self.failures, self.errors)
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/zope.testing-3.9.4_p1-py2.6.egg/zope/testing/testrunner/runner.py", line 377, in run_layer
>    return run_tests(options, tests, layer_name, failures, errors)
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/zope.testing-3.9.4_p1-py2.6.egg/zope/testing/testrunner/runner.py", line 309, in run_tests
>    test(result)
>  File "/usr/lib/python2.6/unittest.py", line 300, in __call__
>    return self.run(*args, **kwds)
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/testtools-0.9.6-py2.6.egg/testtools/testcase.py", line 420, in run
>    return self.__RunTest(self, self.exception_handlers).run(result)
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/testtools-0.9.6-py2.6.egg/testtools/runtest.py", line 67, in run
>    return self._run_one(actual_result)
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/testtools-0.9.6-py2.6.egg/testtools/runtest.py", line 81, in _run_one
>    return self._run_prepared_result(ExtendedToOriginalDecorator(result))
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/testtools-0.9.6-py2.6.egg/testtools/runtest.py", line 89, in _run_prepared_result
>    result.startTest(self.case)
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/testtools-0.9.6-py2.6.egg/testtools/testresult/real.py", line 493, in startTest
>    return self.decorated.startTest(test)
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/zope.testing-3.9.4_p1-py2.6.egg/zope/testing/testrunner/runner.py", line 686, in startTest
>    self.testSetUp()
>  File "/home/bryce/launchpad/lp-sourcedeps/eggs/zope.testing-3.9.4_p1-py2.6.egg/zope/testing/testrunner/runner.py", line 671, in testSetUp
>    layer.testSetUp()
>  File "/home/bryce/launchpad/lp-branches/lp-617699-api/lib/canonical/testing/profiled.py", line 29, in profiled_func
>    return func(cls, *args, **kw)
>  File "/home/bryce/launchpad/lp-branches/lp-617699-api/lib/canonical/testing/layers.py", line 731, in testSetUp
>    cls._db_fixture.setUp()
> AttributeError: 'NoneType' object has no attribute 'setUp'

One of the layers we've torn down has torn down the db fixture object,
it shouldn't have. Its possibly/probably tied into my workaround for
FunctionalLayer et al not being tear-downable.

We could either put a priority on fixing FunctionalLayer etc to be
teardownable, migrate from layers more quickly, or put a hack (with a
logged warning please to resetUp just-in-time).

-Rob



Follow ups

References