Skip to content

Commit a0c1aa2

Browse files
committed
Merge branch 'jk/t0008-sigpipe-fix'
Fix for recent test breakage on 'master'. * jk/t0008-sigpipe-fix: t0008: avoid SIGPIPE race condition on fifo
2 parents d3aeb31 + 4783e7e commit a0c1aa2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

t/t0008-ignores.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,21 @@ test_expect_success PIPE 'streaming support for --stdin' '
697697
# shell, and then echo to the fd. We make sure to close it at
698698
# the end, so that the subprocess does get EOF and dies
699699
# properly.
700+
#
701+
# Similarly, we must keep "out" open so that check-ignore does
702+
# not ever get SIGPIPE trying to write to us. Not only would that
703+
# produce incorrect results, but then there would be no writer on the
704+
# other end of the pipe, and we would potentially block forever trying
705+
# to open it.
700706
exec 9>in &&
707+
exec 8<out &&
701708
test_when_finished "exec 9>&-" &&
709+
test_when_finished "exec 8<&-" &&
702710
echo >&9 one &&
703-
read response <out &&
711+
read response <&8 &&
704712
echo "$response" | grep "^\.gitignore:1:one one" &&
705713
echo >&9 two &&
706-
read response <out &&
714+
read response <&8 &&
707715
echo "$response" | grep "^:: two"
708716
'
709717

0 commit comments

Comments
 (0)