]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/ipc.t: streamline dependency check
authorEric Wong <e@80x24.org>
Tue, 19 Aug 2025 00:33:37 +0000 (00:33 +0000)
committerEric Wong <e@80x24.org>
Wed, 20 Aug 2025 19:10:17 +0000 (19:10 +0000)
We should not be checking for Socket::Msghdr or Inline::C
presence since there is now a 3rd way to support SCM_RIGHTS
passing with the syscall, pack, and unpack perlops.

t/ipc.t

diff --git a/t/ipc.t b/t/ipc.t
index 47c3610353fa47d3f4bdca0eb649dbdebd54909c..d6a4b3414187fc7c782622da24b17945aa3116f4 100644 (file)
--- a/t/ipc.t
+++ b/t/ipc.t
@@ -104,12 +104,10 @@ pipe(my $rc, my $wc);
 open my $warn, '+>', undef;
 $warn->autoflush(0);
 local $SIG{__WARN__} = sub { print $warn "PID:$$ ", @_ };
-my @ppids;
 my $big = try_cat('COPYING') || BAIL_OUT "try_cat(COPYING): $!";
 
 for my $t ('worker', 'worker again') {
-       my $ppid = $ipc->wq_workers_start('wq', 1);
-       push(@ppids, $ppid);
+       $ipc->wq_workers_start('wq', 1);
        $ipc->wq_io_do('test_write_each_fd', [ $wa, $wb, $wc ], 'hello world');
        my $i = 0;
        for my $fh ($ra, $rb, $rc) {
@@ -144,9 +142,7 @@ for my $t ('worker', 'worker again') {
 
 # wq_io_do works across fork (siblings can feed)
 SKIP: {
-       skip 'Socket::MsgHdr or Inline::C missing', 3 if !$ppids[0];
-       is_xdeeply(\@ppids, [$$, undef],
-               'parent pid returned in wq_workers_start');
+       require_mods '+SCM_RIGHTS', 1;
        my $pid = fork;
        if ($pid == 0) {
                use POSIX qw(_exit);
@@ -176,7 +172,7 @@ SKIP: {
 
 $ipc->wq_close;
 SKIP: {
-       skip 'Socket::MsgHdr or Inline::C missing', 11 if !$ppids[0];
+       require_mods '+SCM_RIGHTS', 1;
        seek $warn, 0, SEEK_SET;
        my @warn = <$warn>;
        is(scalar(@warn), 2, 'warned 3 times');
@@ -184,7 +180,7 @@ SKIP: {
        is($warn[0], $warn[1], 'worker did not die');
 
        $SIG{__WARN__} = 'DEFAULT';
-       is($ipc->wq_workers_start('wq', 2), $$, 'workers started again');
+       $ipc->wq_workers_start('wq', 2);
        $ipc->wq_broadcast('test_append_pid', "$tmpdir/append_pid");
        $ipc->wq_close;
        chomp(my @pids = try_cat("$tmpdir/append_pid"));