Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#21147 closed Bug (fixed)

cache.tests.FileBasedCacheTests.test_zero_timeout fails with sqlite on windows

Reported by: Michael Manfre Owned by: nobody
Component: Core (Cache system) Version: 1.6-beta-1
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

cache.tests.FileBasedCacheTests.test_zero_timeout fails with sqlite on windows.

======================================================================
FAIL: test_zero_timeout (cache.tests.FileBasedCacheTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\django\django\tests\cache\tests.py", line 466, in test_zero_timeout
    self.assertEqual(self.cache.get('key1'), None)
AssertionError: u'eggs' != None

Change History (8)

comment:1 by Michael Manfre, 11 years ago

Severity: NormalRelease blocker
Version: master1.6-beta-1

Worked with Django 1.5. This is a regression.

comment:2 by Michael Manfre, 11 years ago

Triage Stage: UnreviewedAccepted

Regression introduced with changeset 89955cc35f3636684ea6f2a6c9504b35a3050f0f #9595

comment:3 by Michael Manfre, 11 years ago

Severity: Release blockerNormal
Type: UncategorizedBug

Not a regression. After manually adding the failing test to 1.5.4, it still fails. Issue is due to precision of time.time() and the speed of the system running the tests. On Windows, the precision is ~15 ms.

Last edited 11 years ago by Michael Manfre (previous) (diff)

comment:4 by Michael Manfre, 11 years ago

https://github.com/django/django/pull/1668

The newly added get_backend_timeout is intentionally not documented to avoid it becoming an officially supported part of the API.

comment:5 by Michael Manfre, 11 years ago

Has patch: set

comment:6 by Claude Paroz, 11 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In bf757a2f4dad519fac1b4a458376de3a040f5ca8:

Fixed #21147 -- Avoided time.time precision issue with cache backends.

The precision of time.time() is OS specific and it is possible for the
resolution to be low enough to allow reading a cache key previously set
with a timeout of 0.

comment:8 by Tim Graham <timograham@…>, 10 years ago

In 40d6b376d4ac29c1f271bb827cd9ca24860ce4b5:

Removed BaseMemcachedCacheMethods._get_memcache_timeout backwards compatibility shim.

Per deprecation timeline; refs #21147.

Note: See TracTickets for help on using tickets.
Back to Top