From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CAA871FA1A for ; Tue, 19 Jan 2021 09:34:35 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 7/9] t/lei: fix double-running of socket test with oneshot Date: Tue, 19 Jan 2021 09:34:33 +0000 Message-Id: <20210119093435.17955-8-e@80x24.org> In-Reply-To: <20210119093435.17955-1-e@80x24.org> References: <20210119093435.17955-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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;