once, this test failed, so add a timer
This commit is contained in:
Robey Pointer 2006-12-27 14:41:21 -05:00
parent 0a63d74a69
commit c570f1a35a
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@ Some unit tests for SSHClient.
import socket import socket
import threading import threading
import time
import unittest import unittest
import weakref import weakref
@ -149,5 +150,9 @@ class SSHClientTest (unittest.TestCase):
p = weakref.ref(self.tc._transport.packetizer) p = weakref.ref(self.tc._transport.packetizer)
self.assert_(p() is not None) self.assert_(p() is not None)
del self.tc 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) self.assert_(p() is None)