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

[PATCH 1/2] t1100-*.sh: Fix an intermittent test failure

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jul 28, 2012, 18:48 UTC
Message-ID
<501433E6.6060904@ramsay1.demon.co.uk>

In particular, the final test ('flags and then non flags') fails intermittently, depending on how much time elapsed between the invocations of "git commit-tree" when creating the commits which later have their commit id's compared. For example, if the commits for childid-3 and childid-4 are created 1 or more seconds apart, then the commits, which would otherwise be identical, will have different commit id's.

In order to make the test reproducible, we remove the variability by setting the author and committer times to a well defined state. We accomplish this with a single call to 'test_tick' at the start of the test.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 t/t1100-commit-tree-options.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/t1100-commit-tree-options.sh b/t/t1100-commit-tree-options.sh
index a3b7723..f8457f9 100755
--- a/t/t1100-commit-tree-options.sh
+++ b/t/t1100-commit-tree-options.sh
@@ -47,6 +47,7 @@ test_expect_success \
 
 
 test_expect_success 'flags and then non flags' '
+	test_tick &&
 	echo comment text |
 	git commit-tree $(cat treeid) >commitid &&
 	echo comment text |
-- 
1.7.11.2
Message 1 of 1 in “t1100-*.sh: Fix an intermittent test failure”
  1. 1/2 t1100-*.sh: Fix an intermittent test failureRamsay Jones, Jul 28, 2012

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.