]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1100-*.sh: Fix an intermittent test failure
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Sat, 28 Jul 2012 18:48:06 +0000 (19:48 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Jul 2012 01:07:47 +0000 (18:07 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1100-commit-tree-options.sh

index a3b77239f48ade053c3514c9ba65cd72286d0783..f8457f9d14c90349b0d3b09a3f695cbfafc3cbbf 100755 (executable)
@@ -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 |