git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] fix flaky untracked-cache test

From
David Turner <dturner@twopensource.com>
Date
Oct 19, 2015, 19:48 UTC
Message-ID
<1445284095-6602-1-git-send-email-dturner@twopensource.com>
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>
---
 t/t7063-status-untracked-cache.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index 37a24c1..0e8d0d4 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -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' '
-- 
2.4.2.644.g97b850b-twtrsrc
Next: Torsten Bögershausen
Message 1 of 5 in “fix flaky untracked-cache test”
  1. fix flaky untracked-cache testDavid Turner, Oct 19, 2015
  2. Torsten BögershausenOct 21, 2015
  3. David TurnerOct 21, 2015
  4. Duy NguyenOct 21, 2015
  5. Lars SchneiderOct 21, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.