From: Junio C Hamano <gitster@pobox.com>
To: "Tao Klerks via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Tao Klerks <tao@klerks.biz>
Subject: Re: [PATCH v2 1/3] t7519: avoid file to index mtime race for untracked cache
Date: Fri, 25 Feb 2022 11:07:54 -0800 [thread overview]
Message-ID: <xmqqr17qbw8l.fsf@gitster.g> (raw)
In-Reply-To: <9421b71540d1f1764db6931d0781576d8a710866.1645809015.git.gitgitgadget@gmail.com> (Tao Klerks via GitGitGadget's message of "Fri, 25 Feb 2022 17:10:12 +0000")
"Tao Klerks via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Tao Klerks <tao@klerks.biz>
>
> In t7519 there is a test that writes files to disk, and immediately
> writes the untracked index. Because of mtime-comparison logic that
"untracked cache", I think.
> uses a 1-second resolution, this means the cached entries are not
> trusted/used under some circumstances
> (see read-cache.c#is_racy_stat()).
>
> Untracked cache tests in t7063 use a 1-second delay to avoid this
> issue, but we don't want to introduce arbitrary slowdowns, so instead
> use test-tool chmtime to backdate the files slightly.
Good approach. Perhaps fixing 7063 can be marked as #leftoverbit?
> This change doesn't actually affect the outcome of the test, but does
> enhance its validity, and becomes relevant after later changes.
>
> Signed-off-by: Tao Klerks <tao@klerks.biz>
> ---
> t/t7519-status-fsmonitor.sh | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh
> index a6308acf006..3f984136ea9 100755
> --- a/t/t7519-status-fsmonitor.sh
> +++ b/t/t7519-status-fsmonitor.sh
> @@ -324,13 +324,19 @@ test_expect_success UNTRACKED_CACHE 'ignore .git changes when invalidating UNTR'
> cd dot-git &&
> mkdir -p .git/hooks &&
> : >tracked &&
> + test-tool chmtime =-60 tracked &&
> : >modified &&
> + test-tool chmtime =-60 modified &&
> mkdir dir1 &&
> : >dir1/tracked &&
> + test-tool chmtime =-60 dir1/tracked &&
> : >dir1/modified &&
> + test-tool chmtime =-60 dir1/modified &&
> mkdir dir2 &&
> : >dir2/tracked &&
> + test-tool chmtime =-60 dir2/tracked &&
> : >dir2/modified &&
> + test-tool chmtime =-60 dir2/modified &&
> write_integration_script &&
> git config core.fsmonitor .git/hooks/fsmonitor-test &&
> git update-index --untracked-cache &&
next prev parent reply other threads:[~2022-02-25 19:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-24 18:29 [PATCH 0/3] Empty untracked cache performance issue Tao Klerks via GitGitGadget
2021-06-24 18:29 ` [PATCH 1/3] Add a second's delay to t7519 for untracked cache Tao Klerks via GitGitGadget
2021-06-29 4:22 ` Junio C Hamano
2021-06-24 18:30 ` [PATCH 2/3] In t7519, populate untracked cache before test Tao Klerks via GitGitGadget
2021-06-24 18:30 ` [PATCH 3/3] Write index when populating empty untracked cache Tao Klerks via GitGitGadget
2021-06-29 4:42 ` Junio C Hamano
2022-02-24 17:52 ` Tao Klerks
2022-02-24 20:35 ` Junio C Hamano
2022-02-25 17:10 ` [PATCH v2 0/3] Empty untracked cache performance issue Tao Klerks via GitGitGadget
2022-02-25 17:10 ` [PATCH v2 1/3] t7519: avoid file to index mtime race for untracked cache Tao Klerks via GitGitGadget
2022-02-25 19:07 ` Junio C Hamano [this message]
2022-02-27 22:12 ` Tao Klerks
2022-02-25 17:10 ` [PATCH v2 2/3] t7519: populate untracked cache before test Tao Klerks via GitGitGadget
2022-02-25 17:10 ` [PATCH v2 3/3] untracked-cache: write index when populating empty untracked cache Tao Klerks via GitGitGadget
2022-02-25 19:12 ` Junio C Hamano
2022-02-27 21:56 ` [PATCH v3 0/3] Empty untracked cache performance issue Tao Klerks via GitGitGadget
2022-02-27 21:56 ` [PATCH v3 1/3] t7519: avoid file to index mtime race for untracked cache Tao Klerks via GitGitGadget
2022-02-27 21:57 ` [PATCH v3 2/3] t7519: populate untracked cache before test Tao Klerks via GitGitGadget
2022-02-27 21:57 ` [PATCH v3 3/3] untracked-cache: write index when populating empty untracked cache Tao Klerks via GitGitGadget
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=xmqqr17qbw8l.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=tao@klerks.biz \
/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).