Re: not all tests pass when on an NFS partition
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 12, 2009, 21:20 UTC
- Message-ID
- <7vk57vjqsd.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <3a69fa7c0902121220n4ea2f19di6fe984dd2002772@mail.gmail.com>
E R <pc88mxer@gmail.com> writes:
> When I run 'make test' for git-1.6.1.3 it will fail on this test when > running on an NFS partition.
... when the filesystem clock and the machine clock are out of sync.
> Is this a known problem? Is this a real problem?
It's a problem whose cause can be easily guessed ;-)
The tests check if the default expiration period (14 days) are honored by creating unreferenced objects that are slightly older and slightly newer than the cut-off timestamp and running the gc. I suspect that the issue with network filesystems whose clock are not grossly skewed can easily be worked around by tweaking these -30 and +1 constants to larger (but not too large to make the tests meaningless) values.
Show 24 quoted lines
> My uname -a: Linux XXX 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:45:01 > EST 2008 i686 athlon i386 GNU/Linux > > > *** t5304-prune.sh *** > * ok 1: setup > * ok 2: prune stale packs > * ok 3: prune --expire > * FAIL 4: gc: implicit prune --expire > > > before=$(git count-objects | sed "s/ .*//") && > BLOB=$(echo aleph_0 | git hash-object -w --stdin) && > BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") && > test $((1 + $before)) = $(git count-objects | sed "s/ .*//") && > test -f $BLOB_FILE && > test-chmtime =-$((86400*14-30)) $BLOB_FILE && > git gc && > test $((1 + $before)) = $(git count-objects | sed "s/ .*//") && > test -f $BLOB_FILE && > test-chmtime =-$((86400*14+1)) $BLOB_FILE && > git gc && > test $before = $(git count-objects | sed "s/ .*//") && > ! test -f $BLOB_FILE