Re: [PATCH] t7063: work around FreeBSD's lazy mtime update feature

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Duy Nguyen <pclouds@xxxxxxxxx> writes:

> OK how about this squashed in? The name was taken from fbsd definition
> IN_LAZYMOD.

I am sorry that I didn't spot this possiblity earlier, but do we
need anything conditional?  Either FREEBSD or LAZYMOD prerequisite
tells very little what the "Work around lazy mtime update" is and
where it triggers (I think the conclusion of your investigation was
that the timestamp on the containing directory, but that is ONLY
recorded in the log message, i.e. readers need to run 'git blame'
to find out).

It might be a better approach to have a helper function with
descriptive name and comment early in t7063, e.g.

	# On some filesystems (e.g. FreeBSD's ext2 and ufs) this
        # and that happens when we do blah, which forces the
        # untracked cache code to take the slow path.  A test
        # that wants to make sure the fast path works correctly
        # should call this helper to make mtime of the containing
        # directory in sync with the reality after doing blah and
        # before checking the fast path behaviour
	test_sync_directory_mtime () {
		ls -ld . >/dev/null
        }

and then call it at strategic places without any prerequisite.

The helper may turn out to be useful outside the context of 7063
later, at which time we can move it to test-lib-functions, but that
is a separate step.

> Off topic. Since I found this macro defined twice, in ext2 and ufs,
> but not in zfs (found its source!), I assume zfs does not have this
> particular feature (but I didn't test it). Untracked cache may be more
> effecient there.


> -- 8< --
> diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
> index 08fc586..8bb048a 100755
> --- a/t/t7063-status-untracked-cache.sh
> +++ b/t/t7063-status-untracked-cache.sh
> @@ -419,7 +419,7 @@ test_expect_success 'create/modify files, some of which are gitignored' '
>  	rm base
>  '
>  
> -test_expect_success FREEBSD 'Work around lazy mtime update' '
> +test_expect_success LAZYMOD 'Work around lazy mtime update' '
>  	ls -ld . >/dev/null
>  '
>  
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 3c730a2..1fc5266 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -962,7 +962,7 @@ case $(uname -s) in
>  	test_set_prereq GREP_STRIPS_CR
>  	;;
>  *FreeBSD*)
> -	test_set_prereq FREEBSD
> +	test_set_prereq LAZYMOD
>  	test_set_prereq POSIXPERM
>  	test_set_prereq BSLASHPSPEC
>  	test_set_prereq EXECKEEPSPID
> -- 8< --
>
> --
> Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]