Merge lp://staging/~allenap/launchpad/enable-isolation-tests-bug-551751 into lp://staging/launchpad

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 12267
Proposed branch: lp://staging/~allenap/launchpad/enable-isolation-tests-bug-551751
Merge into: lp://staging/launchpad
Diff against target: 69 lines (+6/-19)
1 file modified
lib/lp/bugs/externalbugtracker/tests/test_isolation.py (+6/-19)
To merge this branch: bzr merge lp://staging/~allenap/launchpad/enable-isolation-tests-bug-551751
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+47164@code.staging.launchpad.net

Commit message

[r=abentley][ui=none][bug=551751] Fix ordering issues in TestIsolation.setUp() and re-enable its test methods.

Description of the change

Amends TestIsolation.setUp() - see the comment I've added to the code
- and re-enables the test methods.

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :

Don't we always need to define test_suite? Assuming we don't, approved.

I don't really understand why store.execute('SELECT 1') solves these issues, though. Is it simply because it's unknown SQL, so Storm conservatively flushes?

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

Thank you for the review :)

> Don't we always need to define test_suite? Assuming we don't, approved.

The Zope test runner seems to DTRT now (and many other test runners do too).

> I don't really understand why store.execute('SELECT 1') solves these issues,
> though. Is it simply because it's unknown SQL, so Storm conservatively
> flushes?

The difference is that it now does a "SELECT 1" in every store, not just the first (which might be set to auto-commit). At least one of the stores will be set to SERIALIZABLE isolation. As soon as a query is executed in one of these stores a transaction must be started. I suppose I could execute "BEGIN" instead; maybe that would be clearer. In fact, maybe transaction.begin() would be enough! I wonder if I tried that when I wrote these tests the first time...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.