[issue14373] C implementation of functools.lru_cache

Serhiy Storchaka report at bugs.python.org
Sun Jun 7 20:56:06 CEST 2015


Serhiy Storchaka added the comment:

test_lru_cache_threaded is randomly failed on PPC64 PowerLinux buildbot: http://buildbot.python.org/all/builders/PPC64%20PowerLinux%203.x/builds/3573/steps/test/logs/stdio

======================================================================
FAIL: test_lru_cache_threaded (test.test_functools.TestLRUPy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/test_functools.py", line 1129, in test_lru_cache_threaded
    self.assertEqual(hits, 45)
AssertionError: 43 != 45

----------------------------------------------------------------------

The tests looks incorrect, it should fail when cached function is called simultaneously from different threads. Unfortunately it is hard reproduce the failure on other platform.

Proposed patch fixes the test and adds other threaded test, specially for simultaneous call.

----------
Added file: http://bugs.python.org/file39652/test_lru_cache_threaded.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14373>
_______________________________________


More information about the Python-bugs-list mailing list