Opened 3 years ago

Closed 3 years ago

Last modified 20 months ago

#21147 closed Bug (fixed)

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

Reported by: 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


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\", line 466, in test_zero_timeout
    self.assertEqual(self.cache.get('key1'), None)
AssertionError: u'eggs' != None

Change History (8)

comment:1 Changed 3 years ago by manfre

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Severity changed from Normal to Release blocker
  • Version changed from master to 1.6-beta-1

Worked with Django 1.5. This is a regression.

comment:2 Changed 3 years ago by manfre

  • Triage Stage changed from Unreviewed to Accepted

Regression introduced with changeset 89955cc35f3636684ea6f2a6c9504b35a3050f0f #9595

comment:3 Changed 3 years ago by manfre

  • Severity changed from Release blocker to Normal
  • Type changed from Uncategorized to Bug

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 3 years ago by manfre (previous) (diff)

comment:4 Changed 3 years ago by manfre

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

comment:5 Changed 3 years ago by manfre

  • Has patch set

comment:6 Changed 3 years ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

comment:7 Changed 3 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

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 Changed 20 months ago by Tim Graham <timograham@…>

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