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

Re: [PATCH] t3306,t5304: avoid clock skew issues

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2011, 20:20 UTC
Message-ID
<7vipuo336t.fsf@alter.siamese.dyndns.org>
In-Reply-To
<b384c3adae96498eafb2a1faddeaabe85a0f7225.1302285490.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 30 quoted lines
> On systems where the local time and file modification time may be out of
> sync (e.g. test directory on NFS) t3306 and t5305 can fail because prune
> compares times such as "now" (client time) with file modification times
> (server times for remote file systems). I.e., these are spurious test
> failures.
>
> Avoid this by setting the relevant modification times to the local time.
>
> Noticed on a system with as little as 2s time skew.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> I don't think we can safeguard prune itself properly. A filesystem may be out
> of time sync sporadically (and produce incorrect time stamps) but then be in
> sync when "git prune" is run so that we can't detect it.
>
>  t/t3306-notes-prune.sh |    4 ++++
>  t/t5304-prune.sh       |    3 ++-
>  2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/t/t3306-notes-prune.sh b/t/t3306-notes-prune.sh
> index c428217..3114972 100755
> --- a/t/t3306-notes-prune.sh
> +++ b/t/t3306-notes-prune.sh
> @@ -20,6 +20,10 @@ test_expect_success 'setup: create a few commits with notes' '
>  	git add file3 &&
>  	test_tick &&
>  	git commit -m 3rd &&
> +	COMMIT=$(git rev-parse HEAD) &&
> +	COMMIT_FILE=.git/objects/$(echo $COMMIT | sed "s/^../&\//") &&

Hmm, the remainder of the test script seems to know this commit is 5ee1c35 all over the place. Do the above two lines worth it?

Previous: Michael J GruberNext: Michael J Gruber
Message 2 of 4 in “t3306,t5304: avoid clock skew issues”
  1. t3306,t5304: avoid clock skew issuesMichael J Gruber, Apr 8, 2011
  2. Junio C HamanoApr 8, 2011
  3. Michael J GruberApr 8, 2011
  4. [PATCHv2] t3306,t5304: avoid clock skew issuesMichael J Gruber, Apr 14, 2011

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.