Re: [PATCH v2 1/3] t7519: avoid file to index mtime race for untracked cache
- From
Tao Klerks <tao@klerks.biz>
- Date
- Feb 27, 2022, 22:12 UTC
- Message-ID
- <CAPMMpoi4oQ4nORc-Jq00pFQq7eFYe0mZhwdU7fvTabvCdL1Okw@mail.gmail.com>
- In-Reply-To
- <xmqqr17qbw8l.fsf@gitster.g>
On Fri, Feb 25, 2022 at 8:07 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> > "Tao Klerks via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > 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. >
Yep, fixed, thx.
Show 10 quoted lines
> > 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? >
Sure. Updated the commit msg.
I also started another thread with what that looks like - it's not very pretty in the end because of Windows compatibility issues, and still incomplete because (as far as I can tell) the sleep is used for a couple of different purposes, and only one of them lends itself to chmtime manipulation.