[PATCH 4/3] t3700: avoid racy git situation
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 8, 2007, 14:14 UTC
- Message-ID
- <Pine.LNX.4.64.0711081414160.4362@racer.site>
- In-Reply-To
- <Pine.LNX.4.64.0711081213580.4362@racer.site>
Wow, the builtin commit is fast. It sometimes triggers a racy situation in the test case for "git add --refresh -- foo".
So when that test fails, simply sleep one second and try again.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- t/t3700-add.sh | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/t/t3700-add.sh b/t/t3700-add.sh index a328bf5..f4950a3 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -152,7 +152,12 @@ test_expect_success 'git add --refresh' ' *) echo fail; (exit 1);; esac && git add --refresh -- foo && - test -z "`git diff-index HEAD -- foo`" + test -z "`git diff-index HEAD -- foo`" || { + echo Sleeping one second to avoid racy situation && + sleep 1 && + git add --refresh -- foo && + test -z "`git diff-index HEAD -- foo`" + } ' test_done
-- 1.5.3.5.1634.g0fa78