On Mon, Apr 03, 2006 at 12:56:07AM -0400, Randy W. Sims wrote:
> Scott W Gifford wrote:
> >I just uploaded to CPAN some FTP-related modules
> >(Net::FTP::AutoReconnect and Net::FTP::RetrHandle).  In one of the
> >unit tests, I connect to ftp.cpan.org and retreive MIRRORED.BY to make
> >sure everything works OK.
> >
> >Just in the last little bit, though, I've noticed that a connection to
> >ftp.cpan.org is timing out.
> >
> >So my questions are:
> >
> >  * Is ftp.cpan.org a reliable way to access CPAN?  Is there a more
> >    reliable way, besides looking and MIRRORED.BY?
> >
> >  * Is testing by connecting to CPAN an appropriate thing to do?
> 
> I would guess not. Certainly not without asking permission.

In the general case, having module tests make external network connections is
a bad idea

1: You are assuming that people will be building your module on a network
   connected computer. This is never 100% true.

2: Your module's tests can fail due to external factors beyond your control,
   such as people screwing up DNS, or having other outages. Random test
   failures tends to annoy your users, and will lead to bug reports.
   The annoyance is particularly great within organisations running full build
   tests overnight, because sooner rather than later the tests will fail.

Nicholas Clark

Reply via email to