Re: [PATCH 8/7] tests: Fix race condition in t7006-pager
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Feb 22, 2010, 09:12 UTC
- Message-ID
- <20100222091230.GA16490@progeny.tock>
- In-Reply-To
- <20100222084633.GA14432@progeny.tock>
Jonathan Nieder wrote:
Show 5 quoted lines
> Johannes Sixt wrote: > > > Don't the following pager settings suffer from a race condition? > > Yes. Thanks for noticing.
And to save the reader time wondering: yes, the following examples suffer from the same race, but if they are used then we _want_ the test to fail. It might make sense to squash them in anyway to make the patch more self-explanatory.
There is also an instance of PAGER='cat > paginated.out'; since the pager string only starts with but does not equal "cat", this works fine. It needed for test ‘12: color when writing to a pager’ to be able to read the paginated output.
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh index ec6fd06..d9202d5 100755 --- a/t/t7006-pager.sh +++ b/t/t7006-pager.sh @@ -157,7 +157,7 @@ test_expect_success TTY 'PAGER overrides default pager' ' unset GIT_PAGER rm -f core.pager_used test_expect_success TTY 'core.pager overrides PAGER' ' - PAGER=: && + PAGER=wc && export PAGER && git config core.pager "wc > core.pager_used" && test_terminal git log && @@ -166,7 +166,7 @@ test_expect_success TTY 'core.pager overrides PAGER' ' rm -f GIT_PAGER_used test_expect_success TTY 'GIT_PAGER overrides core.pager' ' - git config core.pager : && + git config core.pager wc && GIT_PAGER="wc > GIT_PAGER_used" && export GIT_PAGER && test_terminal git log &&