Skip to content

Commit

Permalink
Added a test failure if the number of cache misses is too high. 1240-…
Browse files Browse the repository at this point in the history
…tests now fails against trunk, but branch 1240 passes it

Signed-off-by: Andrew Miller <amiller@dappervision.com>
  • Loading branch information
amiller committed May 5, 2012
1 parent 919999a commit ff8a0a5
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/allmydata/test/test_dirnode.py
Expand Up @@ -1102,27 +1102,15 @@ def test_deepcheck_cachemisses(self):
self.set_up_grid()
d = self._test_deepcheck_create()
# Clear the counters and set the rootnode
d.addCallback(lambda rootnode:
d.addCallback(lambda rootnode:
not [ss._clear_counters() for ss
in self.g.wrappers_by_id.values()] or rootnode)
d.addCallback(lambda rootnode: rootnode.start_deep_check().when_done())
def _check_results(r):
self.failUnless(IDeepCheckResults.providedBy(r))
c = r.get_counters()
self.failUnlessReallyEqual(c,
{"count-objects-checked": 4,
"count-objects-healthy": 4,
"count-objects-unhealthy": 0,
"count-objects-unrecoverable": 0,
"count-corrupt-shares": 0,
})
self.failIf(r.get_corrupt_shares())
self.failUnlessReallyEqual(len(r.get_all_results()), 4)
d.addCallback(_check_results)
d.addCallback(lambda _:
d.addCallback(lambda _:
sum([ss.counter_by_methname['slot_readv'] for ss
in self.g.wrappers_by_id.values()]))
def p(count): print; print 'remoteCalls to slot_readv:', count
def p(count): self.failIf(count > 60, 'Expected only 60 cache misses,'
'unfortunately there were %d' % count)
d.addCallback(p)
return d

Expand Down

0 comments on commit ff8a0a5

Please sign in to comment.