about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-09-13 01:50:25 +0000
committerEric Wong <e@80x24.org>2019-09-14 09:36:38 +0000
commit6c89cf6208dd4f5251faeec18dc76ac123335fed (patch)
tree7cf57c7dde544740f880dc5e68f351ca534692e3
parent10319080e23ae676ca447f629ee9cdcbb7e6c285 (diff)
downloadpublic-inbox-6c89cf6208dd4f5251faeec18dc76ac123335fed.tar.gz
-W0 (no workers) should not create any pipes on its own,
and we shouldn't have any deleted FDs if no clients are
connected.

This can find if leaks which may be triggered by PublicInbox::HTTP
(and not Qspawn or GitHTTPBackend).
-rw-r--r--t/httpd-corner.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/httpd-corner.t b/t/httpd-corner.t
index c72bc9c6..af838628 100644
--- a/t/httpd-corner.t
+++ b/t/httpd-corner.t
@@ -526,6 +526,14 @@ SKIP: {
         defined(my $x = getsockopt($sock, SOL_SOCKET, $var)) or die;
         is($x, $accf_arg, 'SO_ACCEPTFILTER unchanged if previously set');
 };
+SKIP: {
+        use PublicInbox::Spawn qw(which);
+        skip 'only testing lsof(8) output on Linux', 1 if $^O ne 'linux';
+        skip 'no lsof in PATH', 1 unless which('lsof');
+        my @lsof = `lsof -p $pid`;
+        is_deeply([grep(/\bdeleted\b/, @lsof)], [], 'no lingering deleted inputs');
+        is_deeply([grep(/\bpipe\b/, @lsof)], [], 'no extra pipes with -W0');
+};
 
 done_testing();