fake librarian columns cannot be looked up by storm

Bug #713764 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

I wanted to use the fake librarian in a test, but ran into a problem. The backtrace:

Error in test lp.code.model.tests.test_branch.TestBranch.test_link_stream
Traceback (most recent call last):
_StringException: Text attachment: traceback
------------
Traceback (most recent call last):
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/testtools-0.9.8-py2.6.egg/testtools/runtest.py", line 169, in _run_user
    return fn(*args, **kwargs)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/testtools-0.9.8-py2.6.egg/testtools/testcase.py", line 499, in _run_test_method
    return self._get_test_method()()
  File "/home/robertc/launchpad/lp-branches/working/lib/lp/code/model/tests/test_branch.py", line 391, in test_link_stream
    blob = self.factory.makeBlob(' ')
  File "/home/robertc/launchpad/lp-branches/working/lib/lp/testing/factory.py", line 335, in with_default_master_store
    return func(*args, **kw)
  File "/home/robertc/launchpad/lp-branches/working/lib/lp/testing/factory.py", line 3498, in makeBlob
    new_uuid = getUtility(ITemporaryStorageManager).new(blob, expires)
  File "/home/robertc/launchpad/lp-branches/working/lib/canonical/launchpad/database/temporaryblobstorage.py", line 139, in new
    TemporaryBlobStorage(uuid=new_uuid, file_alias=file_alias)
  File "/home/robertc/launchpad/lp-branches/working/lib/canonical/database/sqlbase.py", line 215, in __init__
    self._create(None, **kwargs)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/sqlobject.py", line 294, in _create
    self.set(**kwargs)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/sqlobject.py", line 300, in set
    setattr(self, attr, value)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/references.py", line 194, in __set__
    self._relation.link(local, remote, True)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/references.py", line 651, in link
    remote_var = remote_vars[remote_column]
KeyError: <storm.properties.PropertyColumn object at 0x5f421d0>
------------

remote_column has a table of LibraryFileAlias and a name of id. However remove_vars only has columns for *InstrumentedLibraryFileAlias*, so the lookup fails.

This is enough to reproduce:

class TestBranch(TestCaseWithFactory):
    """Test basic properties about Launchpad database branches."""

    layer = DatabaseFunctionalLayer

    def test_link_stream(self):
        # Linking a stream creates a SubunitStream.
        branch = self.factory.makeBranch()
        self.useFixture(FakeLibrarian())
        # ' ' is a small legitimate subunit stream.
        blob = self.factory.makeBlob(' ')

I'm marking this high because faster tests are generally important.

Revision history for this message
Robert Collins (lifeless) wrote :

I'm dropping to low because of the parallel test project which will Save The World.

Changed in launchpad:
importance: High → Low
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.