From c570f1a35a0fde2a576062e84be8d4b91bd3ad91 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Wed, 27 Dec 2006 14:41:21 -0500 Subject: [PATCH] [project @ robey@lag.net-20061227194121-hzrmwbb6ea14unkg] once, this test failed, so add a timer --- tests/test_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index a53ff0e..a8f8bc8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -22,6 +22,7 @@ Some unit tests for SSHClient. import socket import threading +import time import unittest import weakref @@ -149,5 +150,9 @@ class SSHClientTest (unittest.TestCase): p = weakref.ref(self.tc._transport.packetizer) self.assert_(p() is not None) del self.tc + # hrm, sometimes p isn't cleared right away. why is that? + st = time.time() + while (time.time() - st < 5.0) and (p() is not None): + time.sleep(0.1) self.assert_(p() is None)