Merge lp://staging/~free.ekanayaka/txlongpoll/fast-rabbit-reset into lp://staging/txlongpoll

Proposed by Free Ekanayaka
Status: Merged
Merged at revision: 90
Proposed branch: lp://staging/~free.ekanayaka/txlongpoll/fast-rabbit-reset
Merge into: lp://staging/txlongpoll
Diff against target: 145 lines (+51/-15)
6 files modified
.testr.conf (+1/-2)
README (+1/-1)
buildout.cfg (+6/-0)
txlongpoll/testing/client.py (+25/-10)
txlongpoll/tests/__init__.py (+13/-0)
txlongpoll/tests/test_frontend.py (+5/-2)
To merge this branch: bzr merge lp://staging/~free.ekanayaka/txlongpoll/fast-rabbit-reset
Reviewer Review Type Date Requested Status
William Grant (community) code Needs Fixing
Robert Collins (community) Needs Fixing
Review via email: mp+278287@code.staging.launchpad.net

Description of the change

This branch adds a few improvements to the test suite:

- Take advantage of testresources.OptimisingTestSuite in order to avoid a wholesale shutdown/restart of the rabbit process at each test and just delete the queues created by the test instead.

- Silence the Twisted logger in FrontEndAjaxTest.test_render_error.

- Remove the workaround of aborting tearDown early without running any asynchronous logic (see the comment in the code).

- Point buildout to bson 0.4.3 since the default (1.1.1) is not compatible
with Python 2.

To post a comment you must log in.
90. By Free Ekanayaka

Add custom test program

91. By Free Ekanayaka

Revert spurious changes

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

The whole custom runner is not needed, is it? Why is it there. Surely a load_tests hook is much cleaner.

review: Needs Fixing
92. By Free Ekanayaka

Use load_tests protocol

93. By Free Ekanayaka

Fix buildout versions

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

> The whole custom runner is not needed, is it? Why is it there. Surely a
> load_tests hook is much cleaner.

Nice, didn't know about it. Fixed as suggested.

Revision history for this message
Robert Collins (lifeless) :
Revision history for this message
Free Ekanayaka (free.ekanayaka) :
Revision history for this message
William Grant (wgrant) :
review: Approve (code)
Revision history for this message
William Grant (wgrant) wrote :

The new load_tests doesn't seem to work as intended (on at least precise and xenial). If I break at the end and inspect result:

(Pdb) p result
<testresources.OptimisingTestSuite tests=[<unittest2.suite.TestSuite tests=[<unittest2.suite.TestSuite tests=[<txlongpoll.tests.test_client.AMQClosingTest.test_catch_closed [...]

It's an OptimisingTestSuite wrapping a whole lot of normal TestSuites, so the fixture is restarted for each test, and the newly un-neutered tearDown fails.

Overriding loader.suiteClass works, but I wonder if there is a better way.

review: Needs Fixing (code)
94. By Free Ekanayaka

Fix testr configuration

Revision history for this message
William Grant (wgrant) wrote :

As discussed on IRC, the problem was my old version of testresources. Newer versions of OptimisingTestSuite flatten nested test suites, fixing the problem.

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.

Subscribers

People subscribed via source and target branches