Skip to content

Commit bb05510

Browse files
szedergitster
authored andcommitted
t5510: run auto-gc in the foreground
The last test added to 't5510-fetch' in 0898c96 (fetch: release pack files before garbage-collecting, 2016-01-13) may sporadically trigger following error message from the test harness: rm: cannot remove 'trash directory.t5510-fetch/auto-gc/.git': Directory not empty The test in question forces an auto-gc, which, if the system supports it, runs in the background by default, and occasionally takes long enough for the test to finish and for 'test_done' to start housekeeping. This can lead to the test's 'git gc --auto' in the background and 'test_done's 'rm -rf $trash' in the foreground racing each other to create and delete files and directories. It might just happen that 'git gc' re-creates a directory that 'rm -rf' already visited and removed, which ultimately triggers the above error. Disable detaching the auto-gc process to ensure that it finishes before the test can continue, thus avoiding this racy situation. Signed-off-by: SZEDER Gábor <[email protected]> Reviewed-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 816c193 commit bb05510

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/t5510-fetch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
718718
(
719719
cd auto-gc &&
720720
git config gc.autoPackLimit 1 &&
721+
git config gc.autoDetach false &&
721722
GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&
722723
! grep "Should I try again" fetch.out
723724
)

0 commit comments

Comments
 (0)