From ba0b12fb09f7334e930fc2b5a02d7e7824695627 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 6 Nov 2015 15:10:44 -0800 Subject: Hacky cleanup of non-gc'd clients in a loopy test. Re #612 --- tests/test_client.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 3d2e75c9..e080221e 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -193,12 +193,18 @@ class SSHClientTest (unittest.TestCase): (['dss', 'rsa', 'ecdsa'], ['dss']), # Try ECDSA but fail (['rsa', 'ecdsa'], ['ecdsa']), # ECDSA success ): - self._test_connection( - key_filename=[ - test_path('test_{0}.key'.format(x)) for x in attempt - ], - allowed_keys=[types_[x] for x in accept], - ) + try: + self._test_connection( + key_filename=[ + test_path('test_{0}.key'.format(x)) for x in attempt + ], + allowed_keys=[types_[x] for x in accept], + ) + finally: + # Clean up to avoid occasional gc-related deadlocks. + # TODO: use nose test generators after nose port + self.tearDown() + self.setUp() def test_multiple_key_files_failure(self): """ -- cgit v1.2.3