Skip to content

Commit ac0638c

Browse files
committed
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 <[email protected]>
1 parent 68a0f4c commit ac0638c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/test-lib.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,11 @@ test_done () {
10111011
error "Tests passed but trash directory already removed before test cleanup; aborting"
10121012

10131013
cd "$TRASH_DIRECTORY/.." &&
1014-
rm -fr "$TRASH_DIRECTORY" ||
1014+
rm -fr "$TRASH_DIRECTORY" || {
1015+
# try again in a bit
1016+
sleep 5;
1017+
rm -fr "$TRASH_DIRECTORY"
1018+
} ||
10151019
error "Tests passed but test cleanup failed; aborting"
10161020
fi
10171021
test_at_end_hook_

0 commit comments

Comments
 (0)