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

Re: t7063 failure on FreeBSD 10.3 i386/amd64

From
Duy Nguyen <pclouds@gmail.com>
Date
Jul 30, 2016, 13:31 UTC
Message-ID
<20160730133102.GA4871@duynguyen>
In-Reply-To
<CACsJy8D9Cy1bjzXddCTOOT7X3smBBB3xccEg7CHaOKAZruHVag@mail.gmail.com>
On Wed, Jul 27, 2016 at 07:33:17PM +0200, Duy Nguyen wrote:
Show 16 quoted lines
> On Tue, Jul 19, 2016 at 6:12 PM, Duy Nguyen <pclouds@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
Previous: Duy NguyenNext: Duy Nguyen
Message 7 of 24 in “t7063 failure on FreeBSD 10.3 i386/amd64”
  1. Eric WongJul 18, 2016
  2. Eric WongJul 18, 2016
  3. Duy NguyenJul 19, 2016
  4. Eric WongJul 20, 2016
  5. Duy NguyenJul 20, 2016
  6. Duy NguyenJul 27, 2016
  7. Duy NguyenJul 30, 2016
  8. Duy NguyenJul 30, 2016
  9. t7063: work around FreeBSD's lazy mtime update featureNguyễn Thái Ngọc Duy, Jul 30, 2016
  10. Eric WongJul 31, 2016
  11. Eric WongJul 31, 2016
  12. Duy NguyenJul 31, 2016
  13. Torstem BögershausenAug 1, 2016
  14. Duy NguyenAug 1, 2016
  15. Junio C HamanoAug 1, 2016
  16. Duy NguyenAug 2, 2016
  17. Junio C HamanoAug 2, 2016
  18. t7063: work around FreeBSD's lazy mtime update featureNguyễn Thái Ngọc Duy, Aug 3, 2016
  19. Junio C HamanoAug 3, 2016
  20. Duy NguyenAug 3, 2016
  21. t7063: work around FreeBSD's lazy mtime update featureNguyễn Thái Ngọc Duy, Aug 3, 2016
  22. Junio C HamanoAug 3, 2016
  23. Junio C HamanoAug 3, 2016
  24. Duy NguyenAug 4, 2016

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.