Skip to content

Commit

Permalink
t7063: fix flaky untracked-cache test
Browse files Browse the repository at this point in the history
Dirty the test worktree's root directory, as the test expects.

When testing the untracked-cache, we previously assumed that checking
out master would be sufficient to mark the mtime of the worktree's
root directory as racily-dirty.  But sometimes, the checkout would
happen at 12345.999 seconds and the status at 12346.001 seconds,
meaning that the worktree's root directory would not be racily-dirty.
And since it was not truly dirty, occasionally the test would fail.
By making the root truly dirty, the test will always succeed.

Tested by running a few hundred times.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
David Turner authored and Junio C Hamano committed Oct 20, 2015
1 parent 73f9145 commit 9b680fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion t/t7063-status-untracked-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ test_expect_success 'create/modify files, some of which are gitignored' '
echo two bis >done/two &&
echo three >done/three && # three is gitignored
echo four >done/four && # four is gitignored at a higher level
echo five >done/five # five is not gitignored
echo five >done/five && # five is not gitignored
echo test >base && #we need to ensure that the root dir is touched
rm base
'

test_expect_success 'test sparse status with untracked cache' '
Expand Down

0 comments on commit 9b680fb

Please sign in to comment.