Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
8330dae1
Commit
8330dae1
authored
Nov 17, 2006
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Yay! A test case which reproduces #2212..
parent
47981742
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
lib/python/Shared/DC/ZRDB/tests/test_caching.py
lib/python/Shared/DC/ZRDB/tests/test_caching.py
+22
-0
No files found.
lib/python/Shared/DC/ZRDB/tests/test_caching.py
View file @
8330dae1
...
@@ -290,6 +290,28 @@ class TestCaching(TestCase):
...
@@ -290,6 +290,28 @@ class TestCaching(TestCase):
{
44
:
(
'query3'
,
1
,
'conn_id'
)}
{
44
:
(
'query3'
,
1
,
'conn_id'
)}
)
)
def
test_cachefull_but_not_old
(
self
):
# get some old entries for one query in
# (the time are carefully picked to give out-of-order dict keys)
self
.
_do_query
(
'query1'
,
5
)
self
.
_do_query
(
'query1'
,
15
)
self
.
_do_query
(
'query1'
,
43
)
self
.
_check_cache
(
{(
'query1'
,
1
,
'conn_id'
):
(
43
,
'result for query1'
)},
{
5
:
(
'query1'
,
1
,
'conn_id'
),
15
:
(
'query1'
,
1
,
'conn_id'
),
43
:
(
'query1'
,
1
,
'conn_id'
),}
)
# now do another query
self
.
_do_query
(
'query2'
,
41.1
)
# XXX whoops, because {5:True,15:True,43:True}.keys()==[43,5,15]
# the cache/tcache clearing code makes a mistake:
# - the first time round the while loop, we remove 43 from the cache
# and tcache 'cos it matches the time in the cache
# - the 2nd time round, 5 is "too old", so we attempt to check
# if it matches the query in the cache, which blows up :-)
self
.
assertRaises
(
KeyError
,
self
.
_do_query
,
'query3'
,
41.2
)
class
DummyDA
:
class
DummyDA
:
def
__call__
(
self
):
def
__call__
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment