We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17f8113 commit 79cec5fCopy full SHA for 79cec5f
test.py
@@ -682,10 +682,10 @@ def run():
682
# log.info(f"nthreads={nthreads} stats={cache.stats()}")
683
684
assert len(cache) == 32
685
- # FIXME the hit ratio may not be deterministic?
686
# 16 * 2 gets-no-hit + 16 * (nthreads - 1) get-with-hit
687
hits = (nthreads - 1) / (nthreads + 1)
688
- assert cache.hits() == hits
+ # FIXME the hit ratio may not be deterministic?
+ assert abs(cache.hits() - hits) < 0.01
689
690
def test_threads():
691
cache = ctu.LockedCache(ctu.StatsCache(ctu.DictCache()), threading.RLock())
0 commit comments