From: Marc Strapetz <marc.strapetz@syntevo.com>
To: Junio C Hamano <gitster@pobox.com>,
Marc Strapetz via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 1/2] t7508: add tests capturing racy timestamp handling
Date: Thu, 6 Jan 2022 11:21:45 +0100 [thread overview]
Message-ID: <54fc04b3-1b6d-c8c9-f3cc-8c8bd647f187@syntevo.com> (raw)
In-Reply-To: <xmqqczl5hpaq.fsf@gitster.g>
On 05/01/2022 21:59, Junio C Hamano wrote:
>> From: Marc Strapetz <marc.strapetz@syntevo.com>
>>
>> +test_expect_success 'racy timestamps will be fixed for clean worktree' '
>> + echo content >racy-dirty &&
>> + echo content >racy-racy &&
>> + git add racy* &&
>> + git commit -m "racy test files" &&
>> + # let status rewrite the index, if necessary; after that we expect
>> + # no more index writes unless caused by racy timestamps; note that
>> + # timestamps may already be racy now (depending on previous tests)
>> + git status &&
>> + test-tool chmtime =1234567890 .git/index &&
>> + test-tool chmtime --get .git/index >out &&
>> + grep ^1234567890 out &&
>
> If file contents were 1234567890999, this will still hit, but I do
> not think that is what you wanted to see. Perhaps
>
> git status &&
> echo 1234567890 >expect &&
> test-tool chmtime=$(cat expect) .git/index &&
> test-tool chmtime --get .git/index >actual &&
> test_cmp expect actual
>
> or something? But I think you inherited this bogosity from the
> previous test, so I am OK to add a few more copies of the same
> bogosity to the test.
>
> Somebody later has to step in and clean them all up, though. When
> that happens, we should document how the magic 1234567890 timestamp
> was chosen near its first use.
It seems like this pattern was used only once before my changes, hence I
will extract to test-lib-functions.sh and fix the bogosity for the next
version of my patch.
-Marc
next prev parent reply other threads:[~2022-01-06 10:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 13:56 [PATCH] update-index: refresh should rewrite index in case of racy timestamps Marc Strapetz via GitGitGadget
2021-12-22 23:52 ` Junio C Hamano
2021-12-23 18:24 ` Marc Strapetz
2022-01-05 13:15 ` [PATCH v2 0/2] " Marc Strapetz via GitGitGadget
2022-01-05 13:15 ` [PATCH v2 1/2] t7508: add tests capturing racy timestamp handling Marc Strapetz via GitGitGadget
2022-01-05 20:59 ` Junio C Hamano
2022-01-06 10:21 ` Marc Strapetz [this message]
2022-01-05 13:15 ` [PATCH v2 2/2] update-index: refresh should rewrite index in case of racy timestamps Marc Strapetz via GitGitGadget
2022-01-05 21:03 ` Junio C Hamano
2022-01-06 22:34 ` [PATCH v3 0/4] " Marc Strapetz via GitGitGadget
2022-01-06 22:34 ` [PATCH v3 1/4] test-lib: introduce API for verifying file mtime Marc Strapetz via GitGitGadget
2022-01-06 23:55 ` Junio C Hamano
2022-01-06 22:34 ` [PATCH v3 2/4] t7508: fix bogus mtime verification Marc Strapetz via GitGitGadget
2022-01-06 22:34 ` [PATCH v3 3/4] t7508: add tests capturing racy timestamp handling Marc Strapetz via GitGitGadget
2022-01-06 22:34 ` [PATCH v3 4/4] update-index: refresh should rewrite index in case of racy timestamps Marc Strapetz via GitGitGadget
2022-01-07 11:17 ` [PATCH v4 0/4] " Marc Strapetz via GitGitGadget
2022-01-07 11:17 ` [PATCH v4 1/4] test-lib: introduce API for verifying file mtime Marc Strapetz via GitGitGadget
2022-01-07 11:17 ` [PATCH v4 2/4] t7508: fix bogus mtime verification Marc Strapetz via GitGitGadget
2022-01-07 11:17 ` [PATCH v4 3/4] t7508: add tests capturing racy timestamp handling Marc Strapetz via GitGitGadget
2022-01-07 11:17 ` [PATCH v4 4/4] update-index: refresh should rewrite index in case of racy timestamps Marc Strapetz 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=54fc04b3-1b6d-c8c9-f3cc-8c8bd647f187@syntevo.com \
--to=marc.strapetz@syntevo.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.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).