Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-01-29 17:19:35 +0300
committerJunio C Hamano <gitster@pobox.com>2019-01-29 20:26:47 +0300
commit046e90d1c98addb9658b855f0f1253682a777cd2 (patch)
treefd854cf16189c7096542400f57b2c6acd7e3f6a1 /t
parentaf9912efaf9d70ef96c63dfc28043b0b856cd516 (diff)
mingw: try to work around issues with the test cleanup
It seems that every once in a while in the Git for Windows SDK, there are some transient file locking issues preventing the test clean up to delete the trash directory. Let's be gentle and try again five seconds later, and only error out if it still fails the second time. This change helps Windows, and does not hurt any other platform (normally, it is highly unlikely that said deletion fails, and if it does, normally it will fail again even 5 seconds later). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/test-lib.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index f31a1c8f796..9c0ca5effb2 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1104,7 +1104,11 @@ test_done () {
error "Tests passed but trash directory already removed before test cleanup; aborting"
cd "$TRASH_DIRECTORY/.." &&
- rm -fr "$TRASH_DIRECTORY" ||
+ rm -fr "$TRASH_DIRECTORY" || {
+ # try again in a bit
+ sleep 5;
+ rm -fr "$TRASH_DIRECTORY"
+ } ||
error "Tests passed but test cleanup failed; aborting"
fi
test_at_end_hook_