AppServer layer explodes during setUp when DB revision is incorrect

Bug #487628 reported by Данило Шеган
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Jonathan Lange

Bug Description

Unlike bin/test or 'make run', if DB has not been updated with 'make schema', running windmill tests fails with a failure how appserver can't be started instead of warning about database revision.

$ bin/test -vv --layer=TranslationsWindmillLayer
Running tests at level 1
Running lp.translations.windmill.testing.TranslationsWindmillLayer tests:
  Set up canonical.testing.layers.BaseLayer in 0.009 seconds.
  Set up canonical.testing.layers.DatabaseLayer in 0.347 seconds.
  Set up canonical.testing.layers.LibrarianLayer in 7.770 seconds.
  Set up canonical.testing.layers.LaunchpadLayer in 0.000 seconds.
  Set up canonical.testing.layers.FunctionalLayer in 4.702 seconds.
  Set up canonical.testing.layers.GoogleServiceLayer in 2.453 seconds.
  Set up canonical.testing.layers.LaunchpadFunctionalLayer in 0.000 seconds.
  Set up canonical.testing.layers.AppServerLayer Traceback (most recent call last):
  File "/home/danilo/launchpad/sourcecode/eggs/zope.testing-3.8.1-py2.5.egg/zope/testing/testrunner/runner.py", line 364, in run_layer
    setup_layer(options, layer, setup_layers)
  File "/home/danilo/launchpad/sourcecode/eggs/zope.testing-3.8.1-py2.5.egg/zope/testing/testrunner/runner.py", line 624, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/home/danilo/launchpad/sourcecode/eggs/zope.testing-3.8.1-py2.5.egg/zope/testing/testrunner/runner.py", line 624, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/home/danilo/launchpad/sourcecode/eggs/zope.testing-3.8.1-py2.5.egg/zope/testing/testrunner/runner.py", line 629, in setup_layer
    layer.setUp()
  File "/home/danilo/launchpad/trees/bug-487601/lib/canonical/testing/profiled.py", line 29, in profiled_func
    return func(cls, *args, **kw)
  File "/home/danilo/launchpad/trees/bug-487601/lib/canonical/testing/layers.py", line 1620, in setUp
    LayerProcessController.startAppServer()
  File "/home/danilo/launchpad/trees/bug-487601/lib/canonical/testing/profiled.py", line 29, in profiled_func
    return func(cls, *args, **kw)
  File "/home/danilo/launchpad/trees/bug-487601/lib/canonical/testing/layers.py", line 1468, in startAppServer
    cls._waitUntilAppServerIsReady()
  File "/home/danilo/launchpad/trees/bug-487601/lib/canonical/testing/layers.py", line 1585, in _waitUntilAppServerIsReady
    connection = urlopen(root_url)
  File "/usr/lib/python2.5/urllib.py", line 82, in urlopen
    return opener.open(url)
  File "/usr/lib/python2.5/urllib.py", line 190, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.5/urllib.py", line 328, in open_http
    errcode, errmsg, headers = h.getreply()
  File "/usr/lib/python2.5/httplib.py", line 1199, in getreply
    response = self._conn.getresponse()
  File "/usr/lib/python2.5/httplib.py", line 928, in getresponse
    response.begin()
  File "/usr/lib/python2.5/httplib.py", line 385, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.5/httplib.py", line 343, in _read_status
    line = self.fp.readline()
  File "/usr/lib/python2.5/socket.py", line 372, in readline
    data = recv(1)
IOError: [Errno socket error] (104, 'Connection reset by peer')

Tearing down left over layers:
  Tear down canonical.testing.layers.LaunchpadFunctionalLayer in 0.000 seconds.
  Tear down canonical.testing.layers.LaunchpadLayer in 0.000 seconds.
  Tear down canonical.testing.layers.LibrarianLayer in 0.403 seconds.
  Tear down canonical.testing.layers.GoogleServiceLayer in 0.061 seconds.
  Tear down canonical.testing.layers.FunctionalLayer ... not supported
  Tear down canonical.testing.layers.DatabaseLayer in 0.216 seconds.
  Tear down canonical.testing.layers.BaseLayer in 0.000 seconds.

Tests with errors:
   runTest (zope.testing.testrunner.runner.SetUpLayerFailure)

** 2 import policy violations **

There were 2 imports of names not appearing in the __all__.
You should not import domain_match from cookielib:
    canonical.launchpad.webapp.session
You should not import mktime_tz from email.Utils:
    canonical.launchpad.database.message

Related branches

tags: added: build-infrastructure
Jonathan Lange (jml)
Changed in launchpad-foundations:
assignee: nobody → Jonathan Lange (jml)
importance: Undecided → Low
milestone: none → 3.1.12
status: New → In Progress
Jonathan Lange (jml)
summary: - Running bin/test with a windmill layer doesn't indicate when DB revision
- is incorrect
+ AppServer layer explodes during setUp when DB revision is incorrect
Revision history for this message
Jonathan Lange (jml) wrote :

The bug report is a little incorrect:

  * The reported behaviour occurs with any AppServer tests
  * bin/test itself does not warn about database revision, it also explodes, but with a different (and more helpful) error

To reproduce the bug, create a new database patch file (touch database/schema/patch-2207-17-0.sql), and run './bin/test -vv test_launchpadlib'.

To demonstrate the presumably expected behaviour, run './bin/test -vv test_branchcollection'. Note that the error happens during the layer's testSetUp.

I've produced a fix, and linked the branch to this report.

Revision history for this message
Diogo Matsubara (matsubara) wrote : Bug fixed by a commit
Changed in launchpad-foundations:
status: In Progress → Fix Committed
Jonathan Lange (jml)
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.