[MacPorts] #62231: git 2.30.0_0 [+credential_osxkeychain+diff_highlight+doc+pcre+perl5_28]: port test fails
MacPorts
noreply at macports.org
Sun Feb 7 04:26:54 UTC 2021
#62231: git 2.30.0_0 [+credential_osxkeychain+diff_highlight+doc+pcre+perl5_28]:
port test fails
-----------------------+----------------------
Reporter: Aloisius | Owner: ci42
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.6.4
Resolution: | Keywords:
Port: git |
-----------------------+----------------------
Comment (by Aloisius):
This appears to be some issue that only seems to only happen when running
tests via port test. port test fails if I force it to use /usr/bin/git
instead of the one being built to run the tests against. Running the tests
manually from the build dir outside of port test works fine however.
Attached is a stripped down Portfile that is only useful for running port
test git that uses the version in /usr/bin/git. It runs a single test:
t/t7063-status-untracked-cache.sh. The main.log from the run is also
attached.
The 6th test fails because the modification time of the test worktree
directory is changed sometime during/after the 5th test runs which causes
git to report that a directory had changed when it was not expected to.
This only happens when running under port test.
{{{
$ cd git-2.30.0/t/trash\ directory.t7063-status-untracked-cache&& find
worktree -exec ~/bin/mtime '{}' \; |sort -n |tail -15
1612669617.401108161: worktree/one
1612669617.401156160: worktree/two
1612669617.401196368: worktree/three
1612669617.401238368: worktree/done/one
1612669617.401241368: worktree/done
1612669617.401275117: worktree/dtwo/two
1612669617.401277951: worktree/dtwo
1612669617.401319617: worktree/dthree/three
1612669617.401322492: worktree/dthree
1612669617.409509364: worktree/.git/objects
1612669617.409997150: worktree/.git/objects/e6
1612669617.410382563: worktree/.git/info/exclude
1612669619.881632275: worktree/.git/index
1612669619.938537713: worktree/.git
1612669619.941513265: worktree
}}}
That last entry's mtime should be two seconds prior which is what happens
if you run the test manually from the port's build dir:
{{{
$ sudo -u macports make t7063-status-untracked-cache.sh -C t
GIT_TEST_OPTS="-v -d -x -i -r 1,2,3,4,5" GIT_TEST_INSTALLED="/usr/bin"
$ cd t/trash\ directory.t7063-status-untracked-cache&& find worktree -exec
~/bin/mtime '{}' \; |sort -n |tail -15
1612670454.530433683: worktree/one
1612670454.530481932: worktree/two
1612670454.530524431: worktree/three
1612670454.530528931: worktree
1612670454.530562764: worktree/done/one
1612670454.530565931: worktree/done
1612670454.530598305: worktree/dtwo/two
1612670454.530601472: worktree/dtwo
1612670454.530634680: worktree/dthree/three
1612670454.530637680: worktree/dthree
1612670454.538098303: worktree/.git/objects
1612670454.538595169: worktree/.git/objects/e6
1612670454.538964538: worktree/.git/info/exclude
1612670455.612867296: worktree/.git/index
1612670455.670378567: worktree/.git
}}}
Conceivably, this could cause corruption if git is called from port.
Strangely, there is a function in git specifically to detect this kind of
behavior, but it did not detect it (builtin/update-
index.c:test_if_untracked_cache_is_supported()).
--
Ticket URL: <https://trac.macports.org/ticket/62231#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list