]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pager test: make fake pager consume all its input
authorJonathan Nieder <jrnieder@gmail.com>
Thu, 30 Jan 2014 16:42:32 +0000 (08:42 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Jan 2014 17:07:17 +0000 (09:07 -0800)
Otherwise there is a race: if 'git log' finishes writing before the
pager terminates and closes the pipe, all is well, and if the pager
finishes quickly enough then 'git log' terminates with SIGPIPE.

 died of signal 13 at /build/buildd/git-1.9~rc1/t/test-terminal.perl line 33.
 not ok 6 - LESS and LV envvars are set for pagination

Noticed on Ubuntu PPA builders, where the race was lost about half the
time.  Compare v1.7.0.2~6^2 (tests: Fix race condition in t7006-pager,
2010-02-22).

Reported-by: Anders Kaseorg <andersk@MIT.EDU>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7006-pager.sh

index 7fe3367b6b6b8f4373dfdb9ffc956f8e1670801a..b9365b431d1e412905ddd0efad1f809625224ba9 100755 (executable)
@@ -40,7 +40,7 @@ test_expect_failure TTY 'pager runs from subdir' '
 test_expect_success TTY 'LESS and LV envvars are set for pagination' '
        (
                sane_unset LESS LV &&
-               PAGER="env >pager-env.out" &&
+               PAGER="env >pager-env.out; wc" &&
                export PAGER &&
 
                test_terminal git log