Skip to content

Commit

Permalink
clean up normalize_function_limitied_size test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Mar 15, 2017
1 parent b64169f commit 066e6f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dask/base.py
Expand Up @@ -269,7 +269,7 @@ def normalize_function(func):
return function_cache[func]
except KeyError:
result = _normalize_function(func)
if len(function_cache) > 500: # clear half of cache if full
if len(function_cache) >= 500: # clear half of cache if full
for k in list(function_cache)[::2]:
del function_cache[k]
function_cache[func] = result
Expand Down
2 changes: 1 addition & 1 deletion dask/tests/test_base.py
Expand Up @@ -457,4 +457,4 @@ def test_normalize_function_limited_size():
for i in range(1000):
normalize_function(lambda x: x)

assert 50 < len(function_cache) < 500
assert 50 < len(function_cache) < 600

0 comments on commit 066e6f7

Please sign in to comment.