about summary refs log tree commit homepage
path: root/t/nntpd.t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-15 07:43:17 +0000
committerEric Wong <e@yhbt.net>2020-06-16 00:07:05 +0000
commit01f2e00be4671e1100b6180310c0fd8c0035ebc8 (patch)
tree7a6a2b78e222b4c7ec524b7e7e45046b1659e3ff /t/nntpd.t
parent97cb0db690cc2065e7e3c33ea5f3636dc0b538c5 (diff)
downloadpublic-inbox-01f2e00be4671e1100b6180310c0fd8c0035ebc8.tar.gz
Since IMAP IDLE users aren't expected to issue any commands, we
can terminate their connections immediately on graceful
shutdown.

Furthermore, we need to drop the inotify FD from the epoll set
to avoid warnings during global destruction.  Embarassingly,
this required fixing wacky test ordering from 2a717d13f10fcdc6
("nntpd+imapd: detect replaced over.sqlite3")
Diffstat (limited to 't/nntpd.t')
-rw-r--r--t/nntpd.t34
1 files changed, 16 insertions, 18 deletions
diff --git a/t/nntpd.t b/t/nntpd.t
index d6042d18..b24720eb 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -316,23 +316,6 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
                 my @xap = grep m!Search/Xapian!, @of;
                 is_deeply(\@xap, [], 'Xapian not loaded in nntpd');
         }
-        {
-                setsockopt($s, IPPROTO_TCP, TCP_NODELAY, 1);
-                syswrite($s, 'HDR List-id 1-');
-                select(undef, undef, undef, 0.15);
-                ok($td->kill, 'killed nntpd');
-                select(undef, undef, undef, 0.15);
-                syswrite($s, "\r\n");
-                $buf = '';
-                do {
-                        sysread($s, $buf, 4096, length($buf));
-                } until ($buf =~ /\r\n\z/);
-                my @r = split("\r\n", $buf);
-                like($r[0], qr/^5\d\d /,
-                        'got 5xx response for unoptimized HDR');
-                is(scalar @r, 1, 'only one response line');
-        }
-
         # -compact requires Xapian
         SKIP: {
                 require_mods('Search::Xapian', 2);
@@ -356,7 +339,22 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
                 my @of = xqx([$lsof, '-p', $td->{pid}], undef, $noerr);
                 is(scalar(grep(/\(deleted\)/, @of)), 0, 'no deleted files');
         };
-
+        {
+                setsockopt($s, IPPROTO_TCP, TCP_NODELAY, 1);
+                syswrite($s, 'HDR List-id 1-');
+                select(undef, undef, undef, 0.15);
+                ok($td->kill, 'killed nntpd');
+                select(undef, undef, undef, 0.15);
+                syswrite($s, "\r\n");
+                $buf = '';
+                do {
+                        sysread($s, $buf, 4096, length($buf));
+                } until ($buf =~ /\r\n\z/);
+                my @r = split("\r\n", $buf);
+                like($r[0], qr/^5\d\d /,
+                        'got 5xx response for unoptimized HDR');
+                is(scalar @r, 1, 'only one response line');
+        }
         $n = $s = undef;
         $td->join;
         is($?, 0, 'no error in exited process');