diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2018-10-11 11:43:06 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-12 07:23:29 +0900 |
commit | c6e5607c56a3333681e6f1e5b8879697be8b94cd (patch) | |
tree | bf3b3b6c9adb0f31f522da7ab1db0673c45d44ca /t/t4018/cpp-c++-function | |
parent | split-index: add tests to demonstrate the racy split index problem (diff) | |
download | tgif-c6e5607c56a3333681e6f1e5b8879697be8b94cd.tar.xz |
t1700-split-index: date back files to avoid racy situations
't1700-split-index.sh' checks that the index was split correctly under
various circumstances and that all the different ways to turn the
split index feature on and off work correctly. To do so, most of its
tests use 'test-tool dump-split-index' to see which files have their
cache entries in the split index. All these tests assume that all
cache entries are written to the shared index (called "base"
throughout these tests) when a new shared index is created. This is
an implementation detail: most git commands (basically all except 'git
update-index') don't care or know at all about split index or whether
a cache entry is stored in the split or shared index.
As demonstrated in the previous patch, refreshing a split index is
prone to a variant of the classic racy git issue. The next patch will
fix this issue, but while doing so it will also slightly change this
behaviour: only cache entries with mtime in the past will be written
only to the newly created shared index, but racily clean cache entries
will be written to the new split index (with smudged stat data).
While this upcoming change won't at all affect any git commands, it
will violate the above mentioned assumption of 't1700's tests. Since
these tests create or modify files and create or refresh the split
index in rapid succession, there are plenty of racily clean cache
entries to be dealt with, which will then be written to the new split
indexes, and, ultimately, will cause several tests in 't1700' to fail.
Let's prepare 't1700-split-index.sh' for this upcoming change and
modify its tests to avoid racily clean files by backdating the mtime
of any file modifications (and since a lot of tests create or modify
files, encapsulate it into a helper function).
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4018/cpp-c++-function')
0 files changed, 0 insertions, 0 deletions