git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH jn/pager-lv-default-env] pager test: make fake pager consume all its input

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 30, 2014, 16:42 UTC
Message-ID
<20140130164232.GF27577@google.com>
In-Reply-To
<52E9FC23.2030200@mit.edu>

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>
---
Anders Kaseorg wrote:
> On 01/06/2014 09:14 PM, Jonathan Nieder wrote:
>> +		PAGER="env >pager-env.out" &&
>> +		export PAGER &&
>> +
>> +		test_terminal git log
[...]
Show 5 quoted lines
> On the Ubuntu PPA builders, I’m seeing this new test fail with
> SIGPIPE about half the time:
>
> 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
Good catch.  Sorry for the trouble.
 t/t7006-pager.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 7fe3367..b9365b4 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -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
-- 
1.9.rc1.175.g0b1dcb5
Previous: Anders KaseorgNext: Junio C Hamano
Message 6 of 7 in “pager: set LV=-c alongside LESS=FRSX”
  1. pager: set LV=-c alongside LESS=FRSXJonathan Nieder, Jan 7, 2014
  2. Olaf MeeuwissenJan 7, 2014
  3. Junio C HamanoJan 7, 2014
  4. Andreas SchwabJan 7, 2014
  5. Anders KaseorgJan 30, 2014
  6. pager test: make fake pager consume all its inputJonathan Nieder, Jan 30, 2014
  7. Junio C HamanoJan 31, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.