From 90e3d8101429793b80ac75d4f87ec058f77e5b1d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 19 Jan 2021 09:34:33 +0000 Subject: [PATCH] t/lei: fix double-running of socket test with oneshot We split out t/lei-oneshot.t and t/lei.t so it's easier to isolate run-mode specific bugs and behavior and there's no reason to rerun the socket daemon tests. --- t/lei.t | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/t/lei.t b/t/lei.t index 8eede13e..c804ff59 100644 --- a/t/lei.t +++ b/t/lei.t @@ -234,18 +234,14 @@ if ($ENV{TEST_LEI_ONESHOT}) { local $ENV{XDG_RUNTIME_DIR} = $xrd; $err_filter = qr!\Q$xrd!; $test_lei_common->(); -} - +} else { SKIP: { # real socket - require_mods(qw(Cwd), my $nr = 105); - my $nfd = eval { require Socket::MsgHdr; 5 } // do { + eval { require Socket::MsgHdr; 1 } // do { require PublicInbox::Spawn; - PublicInbox::Spawn->can('send_cmd4') ? 5 : undef; - } // - skip 'Socket::MsgHdr or Inline::C missing or unconfigured', $nr; - + PublicInbox::Spawn->can('send_cmd4'); + } // skip 'Socket::MsgHdr or Inline::C missing or unconfigured', 115; local $ENV{XDG_RUNTIME_DIR} = "$home/xdg_run"; - my $sock = "$ENV{XDG_RUNTIME_DIR}/lei/$nfd.seq.sock"; + my $sock = "$ENV{XDG_RUNTIME_DIR}/lei/5.seq.sock"; ok($lei->('daemon-pid'), 'daemon-pid'); is($err, '', 'no error from daemon-pid'); @@ -297,6 +293,7 @@ SKIP: { # real socket } ok(!kill(0, $new_pid), 'daemon exits after unlink'); # success over socket, can't test without -}; +}; # SKIP +} # else done_testing; -- 2.44.0