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.)
Harden the unittests a little: close connections between tests, and s…
…top the IOLoop before asserting.
these look like good changes; closing connections between tests is a good catch.