← Back to team overview

launchpad-dev team mailing list archive

Trouble with Librarian and LP_PERSISTENT_TEST_SERVICES

 

Hi all,

As you may know you can speed up your local test runs immensely by setting

    LP_PERSISTENT_TEST_SERVICES=1

somewhere, e.g. in your .bashrc. This keeps Librarian and memcached running across test runs so that you don't have to wait for those layers to set up every time you want to run a test.

It turns out there's one risk though. After an unexpected system shutdown, my Librarian consistently failed to start up. Whenever test runs tried to set up LaunchpadFunctionalLayer, I got a traceback ending with:

LayerIsolationError: Librarian has been killed or has hung.Tests should use LibrarianLayer.hide() and LibrarianLayer.reveal() where possible, and ensure the Librarian is restarted if it absolutely must be shutdown: [Errno socket error] (111, 'Connection refused')

( Full traceback at http://paste.ubuntu.com/459509/ )

None of the usual tricks help: make clean, make, make schema, rocketfuel-get, rocketfuel-setup, fresh branch, cleaning out /var/tmp, reboots and so on.

What *did* fix the problem was to run the same tests again but without LP_PERSISTENT_TEST_SERVICES set. That brings the librarian back into a usable state and you can go right back to using persistent test services.


Jeroen



Follow ups