Git Mailing List Archive on
 help / color / Atom feed
From: Max Kirillov <>
To: Carlo Arenas <>,
Cc: Max Kirillov <>,
Subject: [PATCH] t5562: do not reuse output files
Date: Sat, 24 Nov 2018 09:04:28 +0200
Message-ID: <> (raw)
In-Reply-To: <>

Some expected failures of git-http-backend leave running its children
(receive-pack or upload-pack) which still hold opened descriptors
to act.err and with some probability they live long enough to write
their failure messages after next test has already truncated
the files. This causes occasional failures of the test script.

Avoid the issue by unlinking the older files before writing to them.

Reported-by: Carlo Arenas <>
Helped-by: Carlo Arenas <>
Signed-off-by: Max Kirillov <>
Thanks for the analysis. I seem to have guessed the reason.
This patch should prevent it.

I think the tests should somehow make sure there are no such late
processes. I can see 2 options:
* somehow find out in the tests all children and wait for them. I have no idea how.
* make http-backend close handle to its child and wait for it to exit before dying.
  This would not prevent childrenc in general, because http-backend may be killed,
  but not in our expected failure cases

Actually, don't the children receive some SIGHUP? Maybe thy should. However, it
would still take some time for them to handle it, so it does not fully solve the issue
 t/ | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/t/ b/t/
index 90d890d02f..bb53f82c0c 100755
--- a/t/
+++ b/t/
@@ -25,6 +25,8 @@ test_http_env() {
+	(rm -f act.out || true) &&
+	(rm -f act.err || true) &&
 	env \
 		CONTENT_TYPE="application/x-git-$handler_type-pack-request" \
 		QUERY_STRING="/repo.git/git-$handler_type-pack" \
@@ -155,6 +157,8 @@ test_expect_success 'CONTENT_LENGTH overflow ssite_t' '
 test_expect_success 'empty CONTENT_LENGTH' '
+	(rm -f act.out || true) &&
+	(rm -f act.err || true) &&
 	env \
 		QUERY_STRING="service=git-receive-pack" \
 		PATH_TRANSLATED="$PWD"/.git/info/refs \

  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 12:57 [PATCH] t5562: skip if NO_CURL is enabled Carlo Arenas
2018-11-24  7:04 ` Max Kirillov [this message]
2018-11-24  7:34   ` [PATCH] t5562: do not reuse output files Junio C Hamano
2018-11-24  7:47     ` Junio C Hamano
2018-11-24  7:58       ` Max Kirillov
2018-11-24 12:14       ` Jeff King
2018-11-24 13:03       ` Max Kirillov
2018-11-26  2:06         ` Junio C Hamano
2018-11-28  4:17           ` Max Kirillov

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:

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

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Mailing List Archive on

Archives are clonable:
	git clone --mirror git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ \
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone