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
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
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: devel/bzr/ work.x86_ 64/bzr- 0.13/bzr devel/bzr/ work.x86_ 64/bzr- 0.13/bzrlib
# ./bzr selftest test_hashcache_load --verbose
bzr: /usr/obj/
bzrlib: /usr/obj/
running 1 tests... TestHashCache. test_hashcache_ load FAIL 5154ms
test_hashcache.
0 != 1
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= tests.test_ hashcache. TestHashCache)
FAIL: test_hashcache_load (bzrlib.
vvvv[log from bzrlib. tests.test_ hashcache. TestHashCache. test_hashcache_ load]-- /usr/obj/ devel/bzr/ work.x86_ 64/bzr- 0.13/test0000. tmp/ /usr/obj/ devel/bzr/ work.x86_ 64/bzr- 0.13/test0000. tmp/.bzr/ . branch. BzrBranchFormat 5 object at 0xbd1b50> in file:// /usr/obj/ devel/bzr/ work.x86_ 64/bzr- 0.13/test0000. tmp/.bzr/ devel/bzr/ work.x86_ 64/bzr- 0.13/test0000. tmp' 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'
created control directory in file://
creating repository in file://
creating branch <bzrlib.
got branch format Bazaar-NG Metadir branch format 5
got branch format Bazaar-NG Metadir branch format 5
opening working tree '/usr/obj/
failed to open /usr/obj/
write hc
^^^^[log from bzrlib. tests.test_ hashcache. TestHashCache. test_hashcache_ load]-- ------- ------- ------- ------- ------- ------- ------- ------- ------- devel/bzr/ work.x86_ 64/bzr- 0.13/bzrlib/ tests/test_ hashcache. py", line 92, in test_hashcache_load assertEquals( hc.hit_ count, 1)
-------
Traceback (most recent call last):
File "/usr/obj/
self.
AssertionError: 0 != 1
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 1 test in 5.156s
FAILED (failures=1)
tests failed
For completeness, here's one OK run output: devel/bzr/ work.x86_ 64/bzr- 0.13/bzr devel/bzr/ work.x86_ 64/bzr- 0.13/bzrlib
bzr: /usr/obj/
bzrlib: /usr/obj/
running 1 tests... TestHashCache. test_hashcache_ load OK 5034ms
test_hashcache.
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 1 test in 5.036s
OK
tests passed