Rev 5273: Ugly fix for the last test failure. in file:///home/vila/src/bzr/experimental/leaking-tests/

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Jun 23 15:25:17 BST 2010


At file:///home/vila/src/bzr/experimental/leaking-tests/

------------------------------------------------------------
revno: 5273
revision-id: v.ladeuil+lp at free.fr-20100623142517-gsqzupyd30gq7c7r
parent: v.ladeuil+lp at free.fr-20100623082101-ycvtg5az8qg6adfg
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: sftp-leaks
timestamp: Wed 2010-06-23 16:25:17 +0200
message:
  Ugly fix for the last test failure.
-------------- next part --------------
=== modified file 'bzrlib/tests/stub_sftp.py'
--- a/bzrlib/tests/stub_sftp.py	2010-06-23 08:17:20 +0000
+++ b/bzrlib/tests/stub_sftp.py	2010-06-23 14:25:17 +0000
@@ -358,6 +358,15 @@
                                          home=tcs._server_homedir)
         server = tcs._server_interface(tcs)
         ssh_server.start_server(None, server)
+        # FIXME: Long story short:
+        # bt.test_transport.TestSSHConnections.test_bzr_connect_to_bzr_ssh
+        # fails if we wait less than 0.2 seconds... paramiko uses a lot of
+        # timeouts internally which probably mask a synchronisation
+        # problem. Note that this is the only test that requires this hack and
+        # the test may need to be fixed instead, but it's late and the test is
+        # horrible as mentioned in its comments :) -- vila 20100623
+        import time
+        time.sleep(0.2)
 
     def wrap_for_latency(self):
         tcs = self.server.test_case_server

=== modified file 'bzrlib/tests/test_transport.py'
--- a/bzrlib/tests/test_transport.py	2010-05-26 11:05:29 +0000
+++ b/bzrlib/tests/test_transport.py	2010-06-23 14:25:17 +0000
@@ -955,8 +955,12 @@
         ssh_server = stub_sftp.SFTPFullAbsoluteServer(StubSSHServer)
         # We *don't* want to override the default SSH vendor: the detected one
         # is the one to use.
+
+        # FIXME: I don't understand the above comment, SFTPFullAbsoluteServer
+        # inherits from SFTPServer which forces the SSH vendor to
+        # ssh.ParamikoVendor(). So it's forced, not detected. --vila 20100623
         self.start_server(ssh_server)
-        port = ssh_server._listener.port
+        port = ssh_server.port
 
         if sys.platform == 'win32':
             bzr_remote_path = sys.executable + ' ' + self.get_bzr_path()



More information about the bazaar-commits mailing list