git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH] t6022, t6046: fix flaky files-are-updated checks
Date: Fri, 13 Mar 2020 12:18:24 -0700	[thread overview]
Message-ID: <xmqqtv2sawsf.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <pull.725.git.git.1584125875550.gitgitgadget@gmail.com> (Elijah Newren via GitGitGadget's message of "Fri, 13 Mar 2020 18:57:55 +0000")

"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Elijah Newren <newren@gmail.com>
>
> Several tests wanted to verify that files were actually modified by a
> merge, which it would do by checking that the mtime was updated.  In
> order to avoid problems with the merge completing so fast that the mtime
> at the beginning and end of the operation was the same, these tests
> would first set the mtime of a file to something "old".  This "old"
> value was usually determined as current system clock minus one second,
> truncated to the nearest integer.  Unfortunately, it appears the system
> clock and filesystem clock are different and comparing across the two
> runs into race problems resulting in flaky tests.

Good observation (and if we were doing networked filesystems, things
would be worse).

> So, instead of trying to compare across what are effectively two
> different clocks, just avoid using the system clock.  Any new updates to
> files have to give an mtime at least as big as what is already in the
> file, so define "old" as one second before the mtime found in the file
> before the merge starts.

Is there a reason why we prefer as small an offset as possible?  I
am not objecting to the choice of 1 second, but am curious if
anything bad happens if we used a larger offset, say, 2 hours.

Thanks.

  reply	other threads:[~2020-03-13 19:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 18:57 [PATCH] t6022, t6046: fix flaky files-are-updated checks Elijah Newren via GitGitGadget
2020-03-13 19:18 ` Junio C Hamano [this message]
2020-03-13 19:27   ` Elijah Newren
2020-03-13 19:42     ` Junio C Hamano
2020-03-13 20:03 ` [PATCH v2] " Elijah Newren via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtv2sawsf.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).