t7063: fix flaky untracked-cache test
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>
David Turner committed
Oct 19, 2015 at 15:48 UTC
9b680fbd3b47f39e44fe989971676996d4744ed7
1 file changed
+3
-1
t/t7063-status-untracked-cache.sh
+3
-1
@@ -412,7 +412,9 @@ test_expect_success 'create/modify files, some of which are gitignored' '
412
echo two bis >done/two &&
413
echo three >done/three && # three is gitignored
414
echo four >done/four && # four is gitignored at a higher level
415
- echo five >done/five # five is not gitignored
415
+ echo five >done/five && # five is not gitignored
416
+ echo test >base && #we need to ensure that the root dir is touched
417
+ rm base
418
'
419
420
test_expect_success 'test sparse status with untracked cache' '