]> git.ipfire.org Git - thirdparty/git.git/commit - t/t7063-status-untracked-cache.sh
t7063: mtime-mangling instead of delays in untracked cache testing
authorTao Klerks <tao@klerks.biz>
Wed, 2 Mar 2022 06:05:24 +0000 (06:05 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Mar 2022 06:55:10 +0000 (22:55 -0800)
commit9ba83ebfda1137ad7a4d677e6bef57e345288804
tree3f0083d4df29af59ee1a639e3b35bf0c5d834a5c
parent090a3085bc9f2101b69b3c8940278fb7c22f02c9
t7063: mtime-mangling instead of delays in untracked cache testing

The untracked cache test uses an avoid_racy function to deal with
an mtime-resolution challenge in testing: If an untracked cache
entry's mtime falls in the same second as the mtime of the index
the untracked cache was stored in, then it cannot be trusted.

Explicitly delaying tests is a simple effective strategy to
avoid these issues, but should be avoided where possible.

Switch from a delay-based strategy to instead backdating
all file changes using test-tool chmtime, where that is an
option, to shave 9 seconds off the test run time.

Don't update test cases that delay for other reasons, for now at
least (4 seconds).

Signed-off-by: Tao Klerks <tao@klerks.biz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7063-status-untracked-cache.sh