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