about summary refs log tree commit homepage
path: root/t/nntp.t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-16 22:31:22 +0000
committerEric Wong <e@yhbt.net>2020-06-21 00:43:28 +0000
commit0e6ceff37fc38f28a1520d7475f31d47f74ec7e6 (patch)
tree18b8e61fd60f10989b9cffff7417cef050d40e1c /t/nntp.t
parent3c947561fa0678803158f2174ff87992addb3c7e (diff)
downloadpublic-inbox-0e6ceff37fc38f28a1520d7475f31d47f74ec7e6.tar.gz
Having `git cat-file' as a separate process naturally lends
itself to asynchronous dispatch.  Our event loop for -nntpd no
longer blocks on slow git storage.

Pipelining in -imapd was tricky and bugs were exposed by
mbsync(1).  Update t/nntpd.t to support pipelining ARTICLE
requests to ensure we don't have the same problems -imapd
did during development.
Diffstat (limited to 't/nntp.t')
-rw-r--r--t/nntp.t12
1 files changed, 8 insertions, 4 deletions
diff --git a/t/nntp.t b/t/nntp.t
index 2a9f3a4f..1db896cf 100644
--- a/t/nntp.t
+++ b/t/nntp.t
@@ -109,9 +109,12 @@ use_ok 'PublicInbox::Inbox';
         my $mid = 'a@b';
         my $mime = PublicInbox::Eml->new("Message-ID: <$mid>\r\n\r\n");
         my $hdr = $mime->header_obj;
-        my $mock_self = { nntpd => { grouplist => [],
-                                     servername => 'example.com' } };
-        PublicInbox::NNTP::set_nntp_headers($mock_self, $hdr, $ng, 1, $mid);
+        my $mock_self = {
+                nntpd => { grouplist => [], servername => 'example.com' },
+                ng => $ng,
+        };
+        my $smsg = { num => 1, mid => $mid };
+        PublicInbox::NNTP::set_nntp_headers($mock_self, $hdr, $smsg);
         is_deeply([ $mime->header('Message-ID') ], [ "<$mid>" ],
                 'Message-ID unchanged');
         is_deeply([ $mime->header('Archived-At') ], [ "<${u}a\@b/>" ],
@@ -126,7 +129,8 @@ use_ok 'PublicInbox::Inbox';
                 'Xref: set');
 
         $ng->{-base_url} = 'http://mirror.example.com/m/';
-        PublicInbox::NNTP::set_nntp_headers($mock_self, $hdr, $ng, 2, $mid);
+        $smsg->{num} = 2;
+        PublicInbox::NNTP::set_nntp_headers($mock_self, $hdr, $smsg);
         is_deeply([ $mime->header('Message-ID') ], [ "<$mid>" ],
                 'Message-ID unchanged');
         is_deeply([ $mime->header('Archived-At') ],