From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B34F71F47C for ; Mon, 2 Jan 2023 08:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1672647526; bh=Pgn9g9F8PoMAcTgxp10us/XCywM1gESum8u8CpGRtjA=; h=From:To:Subject:Date:From; b=kJjfoIqrK/jVykBW2ffjdi49qv5/hVuXbsNKQlz0/AdXrkQPcTe+O3m9A8/NBO1Va o6PJsnE2s2FRETtADIRIVV33EWhztM/xgT9B9drBYEb5H29zpzlUMxmSqpjzp4eovs O/MCMEns1VO4ta00awN3cGGQgoW/hsAIKDUKYlkQ= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/httpd-unix.t: stop tail(1) before stopping server Date: Mon, 2 Jan 2023 08:18:47 +0000 Message-Id: <20230102081847.1946852-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: When using the `TAIL' environment, the tail(1) process inherits the non-FD_CLOEXEC pipe we introduced in commit 5f9baf725106 (t/httpd-unix: eliminate some busy waits, 2022-12-12). We must ensure that pipe is gone before waiting on -httpd's death by destroying the tail(1) process, first. --- t/httpd-unix.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/httpd-unix.t b/t/httpd-unix.t index c45ff163..414ca0c8 100644 --- a/t/httpd-unix.t +++ b/t/httpd-unix.t @@ -136,6 +136,7 @@ SKIP: { my $pid = $read_pid->($pid_file); is(kill('TERM', $pid), 1, "signaled daemonized $w process"); vec(my $rvec = '', fileno($p0), 1) = 1; + delete $td->{-extra}; # drop tail(1) process is(select($rvec, undef, undef, 1), 1, 'timeout for pipe HUP'); is(my $undef = <$p0>, undef, 'process closed pipe writer at exit'); ok(!-e $pid_file, "$w pid file unlinked at exit");