On Tue, Jan 01, 2019 at 10:43:20PM +0100, Xavier wrote:
> Control: reassign -1 perl-modules-5.28
> Control: severity -1 normal
> 
> Hi all,
> 
> it seems that Net::SMTP->new() fails randomly when launched during
> Net::server::Mail tests: $s is sometimes undefined after this:
> 
>   my $s = Net::SMTP->new( $host, Port => $port, Hello => 'localhost' );

What does $@ contain when this happens?

I couldn't reproduce this myself using the attached, could you look
at providing a reproducible test case?

> http://matrix.cpantesters.org/?dist=Net-Server-Mail+0.26 also shows that
> this rarely happens since the release of 5.28.0 (1/22), never before.
> 
> I added a workaround for now in libnet-server-mail-perl tests (warn and
> return when $s is undefined).

(You probably want to log $@ in this case, too).

Cheers,
Dominic.
#!/usr/bin/perl

use strict;
use warnings;
use Net::SMTP;

STDOUT->autoflush(1);

while (1) {
    print ".";
    my $s = Net::SMTP->new( 'localhost', Port => 25, Hello => 'localhost' );
    defined $s || die $@;
}

Reply via email to