about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-12-13 00:50:17 +0000
committerEric Wong <e@80x24.org>2023-12-13 09:01:54 +0000
commit9dd86d2555177f401aa622e391b7b80b5ee5cf1f (patch)
treec408b5bc5d5673f48dd949d7980a193b4ef5aef7 /t
parentee5cf0a3af06184d7f26b5c482855f43b4b727fe (diff)
downloadpublic-inbox-9dd86d2555177f401aa622e391b7b80b5ee5cf1f.tar.gz
Our read buffering only worked well with the stdout buffering on
glibc and *BSD libc, but not musl.  When reading the stdout of
git(1), we are likely to get smaller buffers and require more
reads on musl-based systems (tested Alpine Linux 3.19.0).

Thus we must prevent ->translate from being called with an empty
argument list (denoting EOF).  We'll also avoid some local
variable assignments while at it and favor the non-OO ->zflush
dispatch inside RepoAtom and WwwCoderepo subclasses.
Diffstat (limited to 't')
-rw-r--r--t/solver_git.t8
1 files changed, 5 insertions, 3 deletions
diff --git a/t/solver_git.t b/t/solver_git.t
index ab8aba15..db672904 100644
--- a/t/solver_git.t
+++ b/t/solver_git.t
@@ -405,14 +405,16 @@ EOF
                 is($res->code, 200, 'Atom feed');
                 SKIP: {
                         require_mods('XML::TreePP', 1);
-                        my $t = XML::TreePP->new->parse($res->content);
+                        my $t = eval { XML::TreePP->new->parse($res->content) }
+                                or diag explain($res);
                         is(scalar @{$t->{feed}->{entry}}, 50,
-                                'got 50 entries');
+                                'got 50 entries') or diag explain([$t, $res]);
 
                         $res = $cb->(GET('/public-inbox/atom/COPYING'));
                         is($res->code, 200, 'file Atom feed');
                         $t = XML::TreePP->new->parse($res->content);
-                        ok($t->{feed}->{entry}, 'got entry');
+                        ok($t->{feed}->{entry}, 'got entry') or
+                                diag explain([ $t, $res ]);
 
                         $res = $cb->(GET('/public-inbox/atom/README.md'));
                         is($res->code, 404, '404 on missing file Atom feed');