Harden the unittests a little: close connections between tests, and stop the IOLoop before asserting. #32

Merged
merged 1 commit into from Dec 14, 2011

Projects

None yet

2 participants

@ajdavis
Contributor
ajdavis commented Dec 14, 2011

I'd hit a bug where ConnectionPools kept sockets open while Mongo was restarted between tests, leading the next socket operation to to fail with "Connection reset by peer."

This patch also stops the IOLoop in test callbacks before making any assertions, to avoid the situation where a callback throws an AssertionError and aborts but leaves the loop running, meaning the test suite will hang forever. (Simply wrapping the outermost test function in a try ... except is insufficient, since Tornado's IOLoop swallows exceptions.)

@jehiah
Member
jehiah commented Dec 14, 2011

these look like good changes; closing connections between tests is a good catch.

@jehiah jehiah merged commit 0b0d48f into bitly:master Dec 14, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment