← Back to team overview

launchpad-dev team mailing list archive

Mysterious storm bug

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I'm getting a weird test failure that seems related to a storm bug.
This has dashed my hopes of getting support for incremental diffs in
merge proposals this cycle.

It was initially only happening when I ran two tests together, i.e. it's
a test environment contamination issue, and initially it was complaining
about a database constraint violation.  I've removed the constraint so
that the underlying issue is clearer.

I've pushed up a branch that demonstrates it:
lp:~abentley/launchpad/storm-bug


This is as best as I could pare it down:

+    def test_storm_bug(self):
+        from lp.testing import login, logout
+        from canonical.launchpad.webapp.interaction import ANONYMOUS
+        from canonical.launchpad.webapp import canonical_url
+        from canonical.launchpad.testing.pages import setupBrowser
+        bmp = self.factory.makeBranchMergeProposal()
+        url = canonical_url(bmp, view_name='+index')
+        naked_user = removeSecurityProxy(self.user)
+        email = naked_user.preferredemail.email
+        logout()
+        browser = setupBrowser(auth="Basic %s:%s" % (str(email), 'test'))
+        browser.open(url)
+        login(ANONYMOUS)
+        diff = self.factory.makeIncrementalDiff()
+        self.useContext(feature_flags())
+        Store.of(diff).flush()

This produces:
Error in test
lp.code.browser.tests.test_branchmergeproposal.TestBranchMergeProposalView.test_storm_bug
Traceback (most recent call last):
_StringException: Text attachment: traceback
- ------------
Traceback (most recent call last):
  File
"/home/abentley/launchpad/stable/eggs/testtools-0.9.6-py2.6.egg/testtools/runtest.py",
line 144, in _run_user
    return fn(*args)
  File
"/home/abentley/launchpad/stable/eggs/testtools-0.9.6-py2.6.egg/testtools/testcase.py",
line 465, in _run_test_method
    testMethod()
  File
"/home/abentley/launchpad/storm-bug/lib/lp/code/browser/tests/test_branchmergeproposal.py",
line 650, in test_storm_bug
    Store.of(diff).flush()
  File
"/home/abentley/launchpad/stable/eggs/storm-0.17_launchpad_1-py2.6-linux-x86_64.egg/storm/store.py",
line 489, in flush
    self._flush_one(obj_info)
  File
"/home/abentley/launchpad/stable/eggs/storm-0.17_launchpad_1-py2.6-linux-x86_64.egg/storm/store.py",
line 557, in _flush_one
    obj_info.event.emit("flushed")
  File
"/home/abentley/launchpad/stable/eggs/storm-0.17_launchpad_1-py2.6-linux-x86_64.egg/storm/references.py",
line 831, in _break_on_remote_flushed
    self.unlink(local_info, remote_info)
  File
"/home/abentley/launchpad/stable/eggs/storm-0.17_launchpad_1-py2.6-linux-x86_64.egg/storm/references.py",
line 727, in unlink
    local_store.remove_flush_order(remote_info, local_info)
  File
"/home/abentley/launchpad/stable/eggs/storm-0.17_launchpad_1-py2.6-linux-x86_64.egg/storm/store.py",
line 424, in remove_flush_order
    self._order[pair] -= 1
KeyError: ({<storm.references.Relation object at 0x9b18d50>: {'remote':
<LibraryFileAlias at 0xa829ed0>}, 'primary_vars':
(<storm.variables.IntVariable object at 0xa82cb90>,), 'store':
<storm.store.Store object at 0x96b08d0>, 'sequence': 1},
{<storm.references.Relation object at 0x66c7b90>: {'remote':
<BranchMergeProposal at 0x8db3750>}, <storm.references.Relation object
at 0xa82d390>: {'remote': <Revision at 0xa8296d0>}, 'store':
<storm.store.Store object at 0x96b08d0>, 'sequence': 1, 'primary_vars':
(<storm.variables.IntVariable object at 0xa82cb18>,),
<storm.references.Relation object at 0xa829f50>: {'flush_order':
set([{<storm.references.Relation object at 0x9b18d50>: {'remote':
<LibraryFileAlias at 0xa829ed0>}, 'primary_vars':
(<storm.variables.IntVariable object at 0xa82cb90>,), 'store':
<storm.store.Store object at 0x96b08d0>, 'sequence': 1}])},
<storm.references.Relation object at 0xa82d310>: {'remote': <Revision at
0x8da2850>}})
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyuIk4ACgkQ0F+nu1YWqI3+6gCeO16emEORAkucBtawB766u6yg
THgAn2KQcTzAyXZXHg0tP3or04tVilBK
=w4MY
-----END PGP SIGNATURE-----