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>

Johannes Schindelin committed Jan 29, 2019 at 06:19 UTC 046e90d1c98addb9658b855f0f1253682a777cd2
1 file changed +5 -1
t/test-lib.sh
+5 -1
@@ -1104,7 +1104,11 @@ test_done () {
1104 error "Tests passed but trash directory already removed before test cleanup; aborting"
1105
1106 cd "$TRASH_DIRECTORY/.." &&
1107 - rm -fr "$TRASH_DIRECTORY" ||
1107 + rm -fr "$TRASH_DIRECTORY" || {
1108 + # try again in a bit
1109 + sleep 5;
1110 + rm -fr "$TRASH_DIRECTORY"
1111 + } ||
1112 error "Tests passed but test cleanup failed; aborting"
1113 fi
1114 test_at_end_hook_