git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org, "SZEDER Gábor" <szeder@ira.uka.de>
Subject: [PATCH] t5510: run auto-gc in the foreground
Date: Sun,  1 May 2016 17:37:43 +0200	[thread overview]
Message-ID: <20160501153743.323-1-szeder@ira.uka.de> (raw)

The last test added to 't5510-fetch' in 0898c9628104 (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 <szeder@ira.uka.de>
---
 t/t5510-fetch.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 38321d19efbe..454d896390c0 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -682,6 +682,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
 	(
 		cd auto-gc &&
 		git config gc.autoPackLimit 1 &&
+		git config gc.autoDetach false &&
 		GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&
 		! grep "Should I try again" fetch.out
 	)
-- 
2.8.2.356.ge684b1d

             reply	other threads:[~2016-05-01 15:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-01 15:37 SZEDER Gábor [this message]
2016-05-02  7:01 ` [PATCH] t5510: run auto-gc in the foreground Johannes Schindelin
2016-05-02 23:55   ` SZEDER Gábor
2016-05-03 11:50     ` SZEDER Gábor
2016-05-04  5:48       ` Johannes Schindelin
2016-05-05 15:14         ` SZEDER Gábor
2016-05-05 15:16           ` [RFC PATCH] gc --auto: don't lie about running in background on Windows SZEDER Gábor
2016-05-05 16:28             ` Junio C Hamano
2016-05-07 14:44               ` SZEDER Gábor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160501153743.323-1-szeder@ira.uka.de \
    --to=szeder@ira.uka.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).