Re: [PATCH 1/3] Add a second's delay to t7519 for untracked cache
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 29, 2021, 04:22 UTC
- Message-ID
- <xmqq8s2t1er6.fsf@gitster.g>
- In-Reply-To
- <c4d2a3cab4bd5243a776002e4f04fead7b1f34c5.1624559402.git.gitgitgadget@gmail.com>
"Tao Klerks via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 10 quoted lines
> 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 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. We should do the same here.
We shouldn't waste wallclock time by slowing down tests, which already take way too much time. If you can use "test-tool chmtime" to pretend as if the index file was written earlier than it actually is, that would be a better solution.
> +avoid_racy() {Style (see below).
> + sleep 1
> +}
> +
> dirty_repo () {