user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] t/httpd-unix.t: stop tail(1) before stopping server
@ 2023-01-02  8:18 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-01-02  8:18 UTC (permalink / raw)
  To: meta

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");

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-02  8:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02  8:18 [PATCH] t/httpd-unix.t: stop tail(1) before stopping server Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).