~sschwarzer/ftputil#155: 
Server ftp.heanet.ie sometimes doesn't connect

In test_public_servers.py, the test tries to connect to public servers and compare the directory output from the ftp command line client with the directory listing retrieved by ftputil.

Sometimes the connection to one of the servers, ftp.heanet.ie, fails and the output from the ftp client becomes

Trying 193.1.193.10...
Not connected.
Not connected.
Not connected.

instead of

Trying 193.1.193.10...
directory line 1
directory line 2
...

So far I've seen this problem only in the Sourcehut build environment, not locally on warpy, and even in the build environment the problem isn't always reproducible.

Status
REPORTED
Submitter
~sschwarzer
Assigned to
Submitted
1 year, 7 months ago
Updated
1 year, 7 months ago
Labels
tests

~sschwarzer 1 year, 7 months ago*

The commands sent to the ftp client are:

user anonymous anonymous@example.com
cd <directory>
dir
bye

Assuming a race condition, I tried adding time.sleep(3) after sending each command to the subprocess, but it didn't help. I still get the "Not connected." responses.

I also tried an actual email address instead of the example.com address, but that didn't help either.

Currently, I see the following options:

  • Accept occasional test failures. That's a bit annoying though.
  • Try to find a different public FTP server. (FTPS should work, too, if I use a corresponding connection class, but I'd like to avoid the extra work. Then again, if the other servers can also connect via FTPS, I'd have a common session factory.)
  • Use only the two other servers for tests. But it would be nice to test three servers.
Register here or Log in to comment, or comment via email.