summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-04-23 09:52:08 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2016-04-23 09:52:08 -0400
commitb4474bb60e8a081968efbfe7de2e5869522455e1 (patch)
tree022c56dc1dd8d7b50048bebb5cf02f2c6d11ea7c
parent4b02a9b424be448aef5e00abe3bb22f56c84144b (diff)
parenta14d266ce13e1909203e59c8b84965070a0aa69f (diff)
Merge branch 'master' into remove-rc4
-rw-r--r--setup.py4
-rw-r--r--sites/www/changelog.rst7
-rw-r--r--tests/test_transport.py18
3 files changed, 26 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 629c28fd..f9c4b4fe 100644
--- a/setup.py
+++ b/setup.py
@@ -41,8 +41,8 @@ try:
from setuptools import setup
kw = {
'install_requires': [
- 'pycrypto >= 2.1, != 2.4',
- 'ecdsa >= 0.11',
+ 'pycrypto>=2.1,!=2.4',
+ 'ecdsa>=0.11',
],
}
except ImportError:
diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst
index f87a6f83..eaf3cd57 100644
--- a/sites/www/changelog.rst
+++ b/sites/www/changelog.rst
@@ -2,6 +2,13 @@
Changelog
=========
+* :support:`612` Identify & work around a race condition in the test for
+ handshake timeouts, which was causing frequent test failures for a subset of
+ contributors as well as Travis-CI (usually, but not always, limited to Python
+ 3.5). Props to Ed Kellett for assistance during some of the troubleshooting.
+* :support:`697` Remove whitespace in our ``setup.py``'s ``install_requires``
+ as it triggers occasional bugs in some versions of ``setuptools``. Thanks to
+ Justin Lecher for catch & original patch.
* :bug:`499` Strip trailing/leading whitespace from lines when parsing SSH
config files - this brings things in line with OpenSSH behavior. Thanks to
Alfredo Esteban for the original report and Nick Pillitteri for the patch.
diff --git a/tests/test_transport.py b/tests/test_transport.py
index a93d8b63..5069e5b0 100644
--- a/tests/test_transport.py
+++ b/tests/test_transport.py
@@ -32,7 +32,7 @@ from hashlib import sha1
import unittest
from paramiko import Transport, SecurityOptions, ServerInterface, RSAKey, DSSKey, \
- SSHException, ChannelException
+ SSHException, ChannelException, Packetizer
from paramiko import AUTH_FAILED, AUTH_SUCCESSFUL
from paramiko import OPEN_SUCCEEDED, OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
from paramiko.common import MSG_KEXINIT, cMSG_CHANNEL_WINDOW_ADJUST, \
@@ -800,6 +800,22 @@ class TransportTest(unittest.TestCase):
"""
verify that we can get a hanshake timeout.
"""
+ # Tweak client Transport instance's Packetizer instance so
+ # its read_message() sleeps a bit. This helps prevent race conditions
+ # where the client Transport's timeout timer thread doesn't even have
+ # time to get scheduled before the main client thread finishes
+ # handshaking with the server.
+ # (Doing this on the server's transport *sounds* more 'correct' but
+ # actually doesn't work nearly as well for whatever reason.)
+ class SlowPacketizer(Packetizer):
+ def read_message(self):
+ time.sleep(1)
+ return super(SlowPacketizer, self).read_message()
+ # NOTE: prettttty sure since the replaced .packetizer Packetizer is now
+ # no longer doing anything with its copy of the socket...everything'll
+ # be fine. Even tho it's a bit squicky.
+ self.tc.packetizer = SlowPacketizer(self.tc.sock)
+ # Continue with regular test red tape.
host_key = RSAKey.from_private_key_file(test_path('test_rsa.key'))
public_host_key = RSAKey(data=host_key.asbytes())
self.ts.add_server_key(host_key)