On Wed, Jul 27, 2016 at 07:33:17PM +0200, Duy Nguyen wrote:
> On Tue, Jul 19, 2016 at 6:12 PM, Duy Nguyen <pclo...@gmail.com> wrote:
> > On Tue, Jul 19, 2016 at 12:54 AM, Eric Wong <e...@80x24.org> wrote:
> >> Oops, forgot to Cc some folks who worked on this :x
> >>
> >> Filesystem is ufs and it fails regardless of whether
> >> soft-updates is enabled or not.
> >
> > Nothing stands out to my eyes, so I'm going to install freebsd this
> > weekend. I hope ufs does not have any nasty surprise for me. Stay
> > tuned.
> 
> The good news is it looks like a false alarm due to a racy test (and
> it happens on ext2 too, zfs not tested), no big flaw or anything
> (phew!). The bad news is, I still have no idea what's happening and
> why is_racy_stat() returns true in this particular case. It'll take
> some more time...

I give up. FreeBSD behaves so weird in this case.

The code of interest is this

    test_expect_success 'test sparse status with untracked cache' '
        : >../trace &&
        avoid_racy &&
        GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
        git status --porcelain >../status.actual &&
        ...
    '

For some reason mtime of current directory is always latest time when
git makes the stat call. Even if I make avoid_racy sleep longer,
several seconds, mtime of "." will be the latest time.

But cwd stat info is _not_ supposed to change! We haven't touched it
while avoid_racy is running. avoid_racy is just a wrapper of
sleep. And sleep does not change cwd's mtime from the shell prompt. I
tried running the script with bash too (suspecting problem with
default shell) and replaced avoid_racy with /bin/sleep. Nothing.

Does our test framework run something in background??? No, it
can't be.

If a stat call is made before avoid_racy, then mtime is pinned down
and does not change anymore. So a "fix" is something like this. I
tried a minimal program that just does "stat" to make sure it's stat
that does it, not some side effect from 'ls'.

diff --git a/t/t7063-status-untracked-cache.sh 
b/t/t7063-status-untracked-cache.sh
index 38b3890..fd199a0 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -421,6 +421,7 @@ test_expect_success 'create/modify files, some of which are 
gitignored' '
 
 test_expect_success 'test sparse status with untracked cache' '
        : >../trace &&
+       ls -d . &&
        avoid_racy &&
        GIT_TRACE_UNTRACKED_STATS="$TRASH_DIRECTORY/trace" \
        git status --porcelain >../status.actual &&

--
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to