From d790b5e9bf1fe85d43583e86dcd86e154da65b72 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 12 Dec 2018 22:09:24 +0100 Subject: [PATCH] ci: try to work around issues with the test cleanup It seems that on some build agents, there might be some transient file locking issues, so when we cannot 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. Signed-off-by: Johannes Schindelin --- t/test-lib.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 14dff5cf1f..251f4d6a96 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -880,7 +880,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_