From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5F1411F4B5; Sat, 16 Nov 2019 06:52:31 +0000 (UTC) Date: Sat, 16 Nov 2019 06:52:31 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH 29/29] t/common: start_script replaces spawn_listener Message-ID: <20191116065231.GA12115@dcvr> References: <20191115095100.25633-1-e@80x24.org> <20191115095100.25633-30-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191115095100.25633-30-e@80x24.org> List-Id: Eric Wong wrote: > diff --git a/t/nntpd.t b/t/nntpd.t > index b516ffd1..eb9be9b7 100644 > --- a/t/nntpd.t > +++ b/t/nntpd.t > @@ -339,6 +336,8 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000 > unlike($eout, qr/wide/i, 'no Wide character warnings'); > } > > +diag "$td"; Oops, diag was leftover and should not be there. > diff --git a/t/v2writable.t b/t/v2writable.t > index 28420bb9..4bb6d733 100644 > --- a/t/v2writable.t > +++ b/t/v2writable.t > @@ -163,12 +163,10 @@ EOF > close $fh or die "close: $!\n"; > my $sock = tcp_server(); > ok($sock, 'sock created'); > - my $pid; > my $len; > - END { kill 'TERM', $pid if defined $pid }; > - my $nntpd = 'blib/script/public-inbox-nntpd'; > - my $cmd = [ $nntpd, '-W0', "--stdout=$out", "--stderr=$err" ]; > - $pid = spawn_listener({ PI_CONFIG => $pi_config }, $cmd, [ $sock ]); > + my $cmd = [ '-nntpd', '-W0', "--stdout=$out", "--stderr=$err" ]; > + my $env = { PI_CONFIG => $pi_config }; > + my $td = start_script($cmd, $env, { 3 => $sock }); > my $host_port = $sock->sockhost . ':' . $sock->sockport; > my $n = Net::NNTP->new($host_port); > $n->group($group); "$n" (Net::NNTP) and "$td" (TestDaemon) going out of scope at the same time seems to trigger some strange ->DESTROY interaction since both classes have a ->DESTROY method. This causes t/v2writable to be stuck until the 60s EvCleanup::later timer fires (well, I'm pretty sure it's the EvCleanup::later timer, since it takes ~60s to fail and not 180s). Trying to strace the nntpd kicks it right away, so I'm trhing to reproduce it and strace the Net::NNTP client process...