Comment 4 for bug 70272

Revision history for this message
Thomas Klausner (tk-giga) wrote :

It seems to be timing-related after all (or there is a random element).
I ran the test in a tight loop
(for i in `jot 100 1 100`; do ./bzr selftest test_hashcache_load --verbose; done)
and it failed 95 times, but was ok 5 times.

Here's the full --verbose output of a failing run:
# ./bzr selftest test_hashcache_load --verbose
       bzr: /usr/obj/devel/bzr/work.x86_64/bzr-0.13/bzr
    bzrlib: /usr/obj/devel/bzr/work.x86_64/bzr-0.13/bzrlib

running 1 tests...
test_hashcache.TestHashCache.test_hashcache_load FAIL 5154ms
    0 != 1

======================================================================
FAIL: test_hashcache_load (bzrlib.tests.test_hashcache.TestHashCache)

vvvv[log from bzrlib.tests.test_hashcache.TestHashCache.test_hashcache_load]--
created control directory in file:///usr/obj/devel/bzr/work.x86_64/bzr-0.13/test0000.tmp/
creating repository in file:///usr/obj/devel/bzr/work.x86_64/bzr-0.13/test0000.tmp/.bzr/.
creating branch <bzrlib.branch.BzrBranchFormat5 object at 0xbd1b50> in file:///usr/obj/devel/bzr/work.x86_64/bzr-0.13/test0000.tmp/.bzr/
got branch format Bazaar-NG Metadir branch format 5
got branch format Bazaar-NG Metadir branch format 5
opening working tree '/usr/obj/devel/bzr/work.x86_64/bzr-0.13/test0000.tmp'
failed to open /usr/obj/devel/bzr/work.x86_64/bzr-0.13/test0000.tmp/.bzr/checkout/stat-cache: [Errno 2] No such file or directory: u'/usr/obj/devel/bzr/work.x86_64/bzr-0.13/test0000.tmp/.bzr/checkout/stat-cache'
write hc

^^^^[log from bzrlib.tests.test_hashcache.TestHashCache.test_hashcache_load]--
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/obj/devel/bzr/work.x86_64/bzr-0.13/bzrlib/tests/test_hashcache.py", line 92, in test_hashcache_load
    self.assertEquals(hc.hit_count, 1)
AssertionError: 0 != 1

----------------------------------------------------------------------
Ran 1 test in 5.156s

FAILED (failures=1)
tests failed

For completeness, here's one OK run output:
       bzr: /usr/obj/devel/bzr/work.x86_64/bzr-0.13/bzr
    bzrlib: /usr/obj/devel/bzr/work.x86_64/bzr-0.13/bzrlib

running 1 tests...
test_hashcache.TestHashCache.test_hashcache_load OK 5034ms

----------------------------------------------------------------------
Ran 1 test in 5.036s

OK
tests passed