* [PATCH 4/6] t/nntpd.t: improve test runnability
2015-09-21 11:11 5% [PATCH 0/6] more NNTP server updates Eric Wong
@ 2015-09-21 11:11 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-09-21 11:11 UTC (permalink / raw)
To: meta
The created socket FD number may not be 3 in the test,
force it to be so inside the child process.
---
t/nntpd.t | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/nntpd.t b/t/nntpd.t
index 527cfc2..d30ed63 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -44,7 +44,6 @@ my %opts = (
Listen => 1024,
);
my $sock = IO::Socket::INET->new(%opts);
-plan skip_all => 'sock fd!=3, cannot test nntpd integration' if fileno($sock) != 3;
my $pid;
END { kill 'TERM', $pid if defined $pid };
{
@@ -78,8 +77,10 @@ EOF
is($fl, FD_CLOEXEC, 'cloexec set by default (Perl behavior)');
$pid = fork;
if ($pid == 0) {
+ use POSIX qw(dup2);
# pretend to be systemd
fcntl($sock, F_SETFD, $fl &= ~FD_CLOEXEC);
+ dup2(fileno($sock), 3) or die "dup2 failed: $!\n";
$ENV{LISTEN_PID} = $$;
$ENV{LISTEN_FDS} = 1;
exec $nntpd, "--stdout=$out", "--stderr=$err";
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/6] more NNTP server updates
@ 2015-09-21 11:11 5% Eric Wong
2015-09-21 11:11 7% ` [PATCH 4/6] t/nntpd.t: improve test runnability Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-09-21 11:11 UTC (permalink / raw)
To: meta
Always finding new bugs. The XHDR Xref performance improvement
is pretty huge, and the XOVER speedup is noticeable as well.
We will begin to implement RFC 3977, AFAIK the latest NNTP RFC.
Eric Wong (6):
msgmap: minor cleanup to move constant declaration
nntp: speed up XHDR Xref for rtin
nntp: speed up xover slightly
t/nntpd.t: improve test runnability
remove bytes:: for length checks
nntp: proper UTF-8 support (hopefully?)
lib/PublicInbox/Filter.pm | 2 +-
lib/PublicInbox/GitCatFile.pm | 5 +++--
lib/PublicInbox/Msgmap.pm | 2 +-
lib/PublicInbox/NNTP.pm | 47 ++++++++++++++++++++++++++++++++++++-------
public-inbox-nntpd | 4 ++--
t/nntpd.t | 3 ++-
6 files changed, 49 insertions(+), 14 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-21 11:11 5% [PATCH 0/6] more NNTP server updates Eric Wong
2015-09-21 11:11 7% ` [PATCH 4/6] t/nntpd.t: improve test runnability Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).