Thread (1 message) 1 message, 1 author, 2025-01-07

Re: [PATCH 02/10] t7422: fix flaky test caused by buffered stdout

From: Junio C Hamano <hidden>
Date: 2025-01-07 16:02:09

Jeff King [off-list ref] writes:
So I think a simpler and more robust version is just this:

  {
	{ yes || true; } &&
	command_expecting_sigpipe; echo $? >status
  } | true

We'll keep producing data in "yes" until the pipe is closed. So it will
closed before command_expecting_sigpipe even starts, and there is no
race there. And because we're using "true" on the right-hand side of the
pipe, nothing is read at all from the pipe. So there's no guessing about
how much might have been read.
;-)
Like I said, this won't help our current situation, but after having
spent a little time on it (before realizing that) I figured it was worth
documenting.
It is always fun to ses these clever hacks on the list.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help