[patch] hashcache fixes
Robert Collins
robertc at robertcollins.net
Sun Jul 9 09:13:01 BST 2006
On Sun, 2006-07-09 at 17:46 +1000, Martin Pool wrote:
Generally +1. One thing I'd like discussed before its committed, and a
couple of thoughts.
The thoughts first: perhaps the working tree test_hashcache test should
go away? With your changes the test is a no-op, its not checking that
caching occurs (which is arguably something we want to test to prevent
performance regressions), nor is it testing for race conditions that a
working tree might experience. (I think the latter is worth testing as
an aspect of workingtree - create a tree, a file, get its vital
statistics, then modify it and check the tree notices.)
> + if not hasattr(os, 'mkfifo'):
> + raise TestSkipped('filesystem fifos not supported on this
> system')
This seems to be a case for just returning to me - its not something
that the person running the testcase can correct. (Which is what we
defined TestSkipped to mean).
+
+ def test_hashcache_hit_old_file(self):
+ """An old file gives a cache hit"""
+ return ### this takes too long to run properly; skipped
This seems to be something to raise TestSkipped on - it is something
that can be changed to run.
That said, heres what I'd like to discuss - some of the tests for the
hash cache seem fragile, because we're depending on the external system
to line up with our expectations to trigger failures. I think it would
make sense - and as we are working on this right now - to to simulate
the external conditions that can cause grief, and run the hashcache
tests against such a simulated system, where we can say 'stating this
file will return a mtime with grantularity of 2 seconds' and 'the system
time is now 1 second later' without needing *either* a FS with 2 second
granularity, nor needing to wait for the system clock to actually move
forward 2 seconds.
Cheers,
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060709/4dcf4e91/attachment.pgp
More information about the bazaar
mailing list