All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Cc: Git mailing list <git@vger.kernel.org>,
	Christian Couder <christian.couder@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH v5] test-lib: run EXPENSIVE tests one at a time
Date: Thu, 3 Dec 2026 10:38:33 +0100	[thread overview]
Message-ID: <axE4meb1_pNz7BTJ@pks.im> (raw)
In-Reply-To: <20261202-ks-ci-long-test-hang-fix-v5-1-aeb09e4dbc25@gmail.com>

On Wed, Dec 02, 2026 at 01:23:30AM +0530, Kaartic Sivaraam wrote:
> Range-diff vs. v4:
> 
> 1:  ad8fa8d872 ! 1:  2fcdeefff3 test-lib: run EXPENSIVE tests one at a time
>      @@ t/test-lib.sh: test_missing_prereq=
> 
>       test_external_has_tap=0
> 
>     ++# Remove the lock only if it still names $1 as its owner, so that
>     ++# a lock someone else has just taken is left alone.

I feel like this comment is a bit on the verbose side as it doesn't
really provide much value over what the code already trivially tells
you, but okay.

>     ++remove_expensive_lock_owned_by_ () {
>     ++	test "$(cat "$expensive_lock_" 2>/dev/null)" = "$1" &&
>     ++	rm -f "$expensive_lock_"
>     ++}

So this is now wrapped in its own function. Makes sense, I guess.

>     @@ t/test-lib.sh: fail_117 () {
>      +have_expensive_lock_=
>      +
>      +expensive_lock_unavailable_ () {
>     -+	say >&3 "cannot take the EXPENSIVE lock, running anyway"
>     ++	echo >&2 "# cannot take the EXPENSIVE lock, running anyway"
>      +	rm -f "$expensive_lock_.$$"
>      +}

Here we now output to stderr, and we cater towards strict TAP parser by
prefixing it with "#". I think this change makes sense, as this should
make it more discoverable when this scenario kicks in.

>     @@ t/test-lib.sh: fail_117 () {
>      +			#
>      +			# Another waiter may have taken it over since we
>      +			# looked, so only remove it if it is still the same.
>     -+			if test "$(cat "$expensive_lock_" 2>/dev/null)" = "$owner"
>     ++			#
>     ++			# Rarely, after a holder is killed, two waiters can
>     ++			# both get past this check and run together.

Heh, it takes courage to claim that a race happens rarely. My experience
is that no matter how unlikely a race, CI systems know to trigger that
race often enough to annoy the hell out of you.

>     ++			if remove_expensive_lock_owned_by_ "$owner"
>      +			then
>     -+				rm -f "$expensive_lock_"
>     ++				echo >&2 "# removing stale EXPENSIVE lock left by PID $owner"
>      +			fi
>      +			continue
>      +		fi

It's a bit funny to say "removing" after you have removed the lock
already. But providing that context can definitely be helpful, I'd
assume.

Anyway, my comments are really only just nits, so please feel free to
ignore them. Other than that I'm happy with this version, thanks!

Patrick

  reply	other threads:[~2026-12-03  9:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  7:40 [PATCH] test-lib: run EXPENSIVE tests one at a time Kaartic Sivaraam
2026-11-19 10:07 ` Patrick Steinhardt
2026-11-19 17:12   ` Kaartic Sivaraam
2026-11-19 17:29 ` [PATCH v2] " Kaartic Sivaraam
2026-11-19 17:33   ` Kaartic Sivaraam
2026-11-20  6:28   ` Junio C Hamano
2026-11-24 13:34     ` Kaartic Sivaraam
2026-11-25 20:21       ` Junio C Hamano
2026-11-27 13:59         ` Kaartic Sivaraam
2026-11-27 18:34           ` Junio C Hamano
2026-11-25 19:09   ` Harald Nordgren
2026-11-27 17:23 ` [PATCH v3] " Kaartic Sivaraam
2026-11-27 20:46   ` Junio C Hamano
2026-11-28  8:06     ` Kaartic Sivaraam
2026-11-28 14:57 ` [PATCH v4 0/2] test-lib: serialize EXPENSIVE tests to avoid OOM in CI Kaartic Sivaraam
2026-11-28 14:57   ` [PATCH v4 1/2] test-lib: run EXPENSIVE tests one at a time Kaartic Sivaraam
2026-11-29 16:55     ` Junio C Hamano
2026-11-30 14:13     ` Christian Couder
2026-12-01 10:14       ` Kaartic Sivaraam
2026-12-01 11:10         ` Christian Couder
2026-12-01 12:34           ` Kaartic Sivaraam
2026-12-01  7:22     ` Patrick Steinhardt
2026-12-01  8:47       ` Kaartic Sivaraam
2026-12-01 11:07         ` Patrick Steinhardt
2026-12-01 12:50           ` Kaartic Sivaraam
2026-12-01 13:19             ` Patrick Steinhardt
2026-11-28 14:58   ` [PATCH v4 2/2] t0000: test taking over and releasing the EXPENSIVE lock Kaartic Sivaraam
2026-12-01  7:23     ` Patrick Steinhardt
2026-12-01  8:49       ` Kaartic Sivaraam
2026-12-01 19:53 ` [PATCH v5] test-lib: run EXPENSIVE tests one at a time Kaartic Sivaraam
2026-12-03  9:38   ` Patrick Steinhardt [this message]
2026-12-03 15:27     ` Kaartic Sivaraam
2026-12-04 10:41 ` [PATCH v6] " Kaartic Sivaraam

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

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

  git send-email \
    --in-reply-to=axE4meb1_pNz7BTJ@pks.im \
    --to=ps@pks.im \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=haraldnordgren@gmail.com \
    --cc=kaartic.sivaraam@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.