All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	Daniels Umanovskis <daniels@umanovskis.se>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH v4] branch: introduce --show-current display option
Date: Wed, 17 Oct 2018 06:39:02 -0400	[thread overview]
Message-ID: <20181017103902.GA12137@flurp.local> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1810171211440.4546@tvgsbejvaqbjf.bet>

On Wed, Oct 17, 2018 at 6:18 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> I realized yesterday that the &&-chain linting we use for every single
> test case takes a noticeable chunk of time:
>
>         $ time ./t0006-date.sh --quiet
>         real    0m20.973s
>         $ time ./t0006-date.sh --quiet --no-chain-lint
>         real    0m13.607s
>
> My suspicion: it is essentially the `(exit 117)` that adds about 100ms to
> every of those 67 test cases.

The subshell chain-linter adds a 'sed' and 'grep' invocation to each test which doesn't help. (v1 of the subshell chain-linter only added a 'sed', but that changed with v2.)

> With that in mind, I would like to suggest that we should start to be very
> careful about using subshells in our test suite.

You could disable the subshell chain-linter like this if you want test the (exit 117) goop in isolation:

--- 8< ---
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3f95bfda60..48323e503c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -675,8 +675,7 @@ test_run_ () {
 		trace=
 		# 117 is magic because it is unlikely to match the exit
 		# code of other programs
-		if $(printf '%s\n' "$1" | sed -f "$GIT_BUILD_DIR/t/chainlint.sed" | grep -q '?![A-Z][A-Z]*?!') ||
-			test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)"
+		if test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)"
 		then
 			error "bug in the test script: broken &&-chain or run-away HERE-DOC: $1"
 		fi
--- 8< ---

  reply	other threads:[~2018-10-17 10:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 20:54 [PATCH v2 0/1] branch: introduce --show-current display option Daniels Umanovskis
2018-10-10 20:54 ` [PATCH v2 1/1] " Daniels Umanovskis
2018-10-11  0:34   ` Jeff King
2018-10-11 15:43     ` Rafael Ascensão
2018-10-11 16:36       ` Daniels Umanovskis
2018-10-11 17:51         ` Jeff King
2018-10-11 20:35           ` Rafael Ascensão
2018-10-11 20:46             ` Daniels Umanovskis
2018-10-11 20:53             ` Jeff King
2018-10-11 22:34               ` Rafael Ascensão
2018-10-11  6:54   ` Junio C Hamano
2018-10-11 17:29     ` Daniels Umanovskis
2018-10-11 17:52       ` Jeff King
2018-10-11 22:20     ` [PATCH v3] " Daniels Umanovskis
2018-10-11 23:15       ` Junio C Hamano
2018-10-11 23:31         ` Daniels Umanovskis
2018-10-12 13:33         ` [PATCH v4] " Daniels Umanovskis
2018-10-12 13:43           ` Eric Sunshine
2018-10-16 23:09             ` Junio C Hamano
2018-10-16 23:26               ` Eric Sunshine
2018-10-17 10:18                 ` Johannes Schindelin
2018-10-17 10:39                   ` Eric Sunshine [this message]
2018-10-18  9:51                     ` Johannes Schindelin
2018-10-18 14:19                       ` Eric Sunshine
2018-10-16  5:59           ` Junio C Hamano
2018-10-17  9:39           ` Rafael Ascensão
2018-10-17 17:36             ` Daniels Umanovskis
2018-10-11 22:53   ` [PATCH v2 1/1] " SZEDER Gábor
2018-10-11 22:56     ` SZEDER Gábor
2018-10-11 22:58       ` Daniels Umanovskis

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=20181017103902.GA12137@flurp.local \
    --to=sunshine@sunshineco.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=daniels@umanovskis.se \
    --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.
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.