git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: git@vger.kernel.org, Johannes Sixt <j6t@kdbg.org>,
	Jeff King <peff@peff.net>, Andreas Schwab <schwab@suse.de>
Subject: Re: [PATCH] t6026: ensure that long-running script really is
Date: Thu, 10 Nov 2016 15:53:43 -0800	[thread overview]
Message-ID: <xmqqfumy51tk.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <16dc9f159b214997f7501006a8d1d8be2ef858e8.1478699463.git.johannes.schindelin@gmx.de> (Johannes Schindelin's message of "Wed, 9 Nov 2016 14:51:22 +0100 (CET)")

Johannes Schindelin <johannes.schindelin@gmx.de> writes:

> When making sure that background tasks are cleaned up in 5babb5b
> (t6026-merge-attr: clean up background process at end of test case,
> 2016-09-07), we considered to let the background task sleep longer, just
> to be certain that it will still be running when we want to kill it
> after the test.
>
> Sadly, the assumption appears not to hold true that the test case passes
> quickly enough to kill the background task within a second.
>
> Simply increase it to an hour. No system can be possibly slow enough to
> make above-mentioned assumption incorrect.
>
> Reported by Andreas Schwab.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> Published-As: https://github.com/dscho/git/releases/tag/t6026-sleep-v1
> Fetch-It-Via: git fetch https://github.com/dscho/git t6026-sleep-v1

OK, I think this is a much better option.  Assuming 3600 is long
enough for everybody (and if not, we have a bigger problem ;-),
it will ensure that the stray process will be around when we run the
'git merge' test, and by not adding "|| :" after the kill, we check
that the stray process is still there, i.e. we tested what we wanted
to test.

Will revert the two patches that were queued previously and then
queue this one.

Thanks.

>
>  t/t6026-merge-attr.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh
> index 7a6e33e..348d78b 100755
> --- a/t/t6026-merge-attr.sh
> +++ b/t/t6026-merge-attr.sh
> @@ -183,16 +183,16 @@ test_expect_success 'up-to-date merge without common ancestor' '
>  
>  test_expect_success 'custom merge does not lock index' '
>  	git reset --hard anchor &&
> -	write_script sleep-one-second.sh <<-\EOF &&
> -		sleep 1 &
> +	write_script sleep-an-hour.sh <<-\EOF &&
> +		sleep 3600 &
>  		echo $! >sleep.pid
>  	EOF
>  	test_when_finished "kill \$(cat sleep.pid)" &&
>  
>  	test_write_lines >.gitattributes \
> -		"* merge=ours" "text merge=sleep-one-second" &&
> +		"* merge=ours" "text merge=sleep-an-hour" &&
>  	test_config merge.ours.driver true &&
> -	test_config merge.sleep-one-second.driver ./sleep-one-second.sh &&
> +	test_config merge.sleep-an-hour.driver ./sleep-an-hour.sh &&
>  	git merge master
>  '
>  
>
> base-commit: be5a750939c212bc0781ffa04fabcfd2b2bd744e

  reply	other threads:[~2016-11-10 23:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 13:51 [PATCH] t6026: ensure that long-running script really is Johannes Schindelin
2016-11-10 23:53 ` Junio C Hamano [this message]
2016-11-11  6:50   ` Johannes Sixt
2016-11-11  8:41     ` Jeff King
2016-11-11 20:24       ` [PATCH v2] " Johannes Sixt
2016-11-11 20:48         ` Junio C Hamano
2016-11-11 20:54           ` Johannes Sixt
2016-11-11 21:09             ` Junio C Hamano
2016-11-11 21:15               ` Johannes Sixt

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=xmqqfumy51tk.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    --cc=schwab@suse.de \
    /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).