Skip to content

Commit 79cec5f

Browse files
author
Fabien Coelho
committed
be more permissive
1 parent 17f8113 commit 79cec5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,10 @@ def run():
682682
# log.info(f"nthreads={nthreads} stats={cache.stats()}")
683683

684684
assert len(cache) == 32
685-
# FIXME the hit ratio may not be deterministic?
686685
# 16 * 2 gets-no-hit + 16 * (nthreads - 1) get-with-hit
687686
hits = (nthreads - 1) / (nthreads + 1)
688-
assert cache.hits() == hits
687+
# FIXME the hit ratio may not be deterministic?
688+
assert abs(cache.hits() - hits) < 0.01
689689

690690
def test_threads():
691691
cache = ctu.LockedCache(ctu.StatsCache(ctu.DictCache()), threading.RLock())

0 commit comments

Comments
 (0)