Increasing FTP test stability

This commit is contained in:
Jay McCarthy 2010-08-28 18:52:29 -06:00
parent 3f8de79ba7
commit bc15f398f2

View File

@ -8,13 +8,21 @@
(thread
(λ ()
(define-values (ip op) (tcp-accept listener))
(define ip->cop-t
(thread (λ ()
(copy-port ip cop)
(copy-port ip cop))))
(define tp->op-t
(thread (λ ()
(copy-port tp op))))
(thread-wait tp->op-t)
(thread-wait ip->cop-t)
(flush-output op)
(flush-output cop)
(close-output-port op)
(close-input-port ip)))
(thread (λ ()
(copy-port tp op)
(close-output-port op)))))
the-port))
(define (ftp-port-split n)
@ -212,6 +220,8 @@ END
(ftp-connection? 1) => #f
(set! conn (ftp-establish-connection server port user passwd))
(ftp-connection? conn)
(when (ftp-connection? conn)
(test
(ftp-cd conn "gnu")
(for ([f (in-list (ftp-directory-list conn))])
(match-define (list type ftp-date name) f)
@ -225,6 +235,10 @@ END
(delete-file (build-path tmp-dir pth))
(delete-directory/files tmp-dir)
(thread-wait pasv1-thread)
(thread-wait pasv2-thread)
(thread-wait main-thread)
(get-output-string cop) =>
#<<END
USER anonymous
@ -235,9 +249,10 @@ LIST
PASV
TYPE I
RETR =README-about-.diff-files
QUIT
END
))
))))
(tests)