patch: more sftp unit tests

Robey Pointer robey at lag.net
Tue Dec 13 04:33:11 GMT 2005


On 9 Dec 2005, at 6:57, John Arbash Meinel wrote:

> Robert Collins wrote:
>> On Thu, 2005-12-08 at 03:28 -0800, Robey Pointer wrote:
>>
>>> The stub sftp server can now be configured to use a home folder for
>>> relative paths, and the TestCaseWithSFTPServer now takes an url path
>>> and relative home folder for configuration.  I just subclassed it
>>> twice to exercise all 3 url formats ... which is 17 tests each, and
>>> not speedy tests, so prepare to wait longer while they run. :)
>>
>> they are slow aren't they: 8-10 times slower than the matching HTTP
>> tests. and about 400 times slower than the local file system matching
>> tests.
>>
>> So - is this something we can fix (is paramiko having performance
>> issues ?)
>>
>> AIUI other than the handshake SFTP should be -fast- locally, and the
>> handshake is surely not worth 1 second of cpu time on my 5 month old
>> laptop.
>
> Part of the problem (I believe), is how the timeout stuff is working.
> That you currently have a specific wait time before the thread will
> clean itself up.

If you mean the event.wait(N) calls, those are actually timeouts --  
if the event isn't triggered before that timeout, the test is failing  
in some fundamental way.  (But it would take 5-30 seconds to fail, so  
we'd know cuz people would *really* be screaming.) :)


> It could be the startup time for the ssh server. In which case we  
> could
> consider spawning the SSH server at some other time, and clean it up
> independently of each test case. Then each test case would just  
> tell the
> SSH server what to consider as root, rather than spawning an entire  
> new one.

I think this is the real problem.  SSH negotiation is hard, and  
(currently) for each unit test, we do each side of the negotiation,  
sync up, do the test, then do a clean sync'd shutdown.

For the paramiko sftp unit tests, I cheated a little bit by having  
the test *class* create the transport and shut it down when the whole  
test suite was done.  If we had transport caching, we could actually  
just have the "stub sftp server" keep running during the whole sftp  
test suite, and bzr's sftp transport would keep reusing the cached  
SSH session.


> I guess we need to profile to figure out where the time is spent.

It would be helpful.  I've been meaning to do the same against  
paramiko with this new lsprof thing when I get the time.   
(Unfortunately my vacation ended today.)

robey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051212/49bfb10f/attachment.pgp 


More information about the bazaar mailing list