Skip to content

Commit 6129c93

Browse files
dschogitster
authored andcommitted
test-lib: limit the output of the yes utility
On Windows, there is no SIGPIPE. A consequence of this is that the upstream process of a pipe does not notice the death of the downstream process until the pipe buffer is full and writing more data returns an error. This behavior is the reason for an annoying delay during the execution of t7610-mergetool.sh: There are a number of test cases where 'yes' is invoked upstream. Since the utility is basically an endless loop it runs, on Windows, until the pipe buffer is full. This does take a few seconds. The test suite has its own implementation of 'yes'. Modify it to produce only a limited amount of output that is sufficient for the test suite. The amount chosen should be sufficiently high for any test case, assuming that future test cases will not exaggerate their demands of input from an upstream 'yes' invocation. [j6t: commit message] Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7548842 commit 6129c93

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/test-lib.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,11 @@ yes () {
907907
y="$*"
908908
fi
909909

910-
while echo "$y"
910+
i=0
911+
while test $i -lt 99
911912
do
912-
:
913+
echo "$y"
914+
i=$(($i+1))
913915
done
914916
}
915917

0 commit comments

Comments
 (0)