Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
c536ed31
Commit
c536ed31
authored
May 26, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save cache verification status for tests
parent
01d74173
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/ZEO/asyncio/client.py
src/ZEO/asyncio/client.py
+7
-0
No files found.
src/ZEO/asyncio/client.py
View file @
c536ed31
...
...
@@ -454,6 +454,7 @@ class Client:
self
.
register_failed_poll
+
local_random
.
random
(),
self
.
try_connecting
)
verify_result
=
None
# for tests
def
verify
(
self
,
last_transaction_promise
):
protocol
=
self
.
protocol
...
...
@@ -463,21 +464,25 @@ class Client:
if
cache
:
cache_tid
=
cache
.
getLastTid
()
if
not
cache_tid
:
self
.
verify_result
=
"Non-empty cache w/o tid"
logger
.
error
(
"Non-empty cache w/o tid -- clearing"
)
cache
.
clear
()
self
.
client
.
invalidateCache
()
self
.
finished_verify
(
server_tid
)
elif
cache_tid
>
server_tid
:
self
.
verify_result
=
"Cache newer than server"
logger
.
critical
(
'Client has seen newer transactions than server!'
)
raise
AssertionError
(
"Server behind client, %r < %r, %s"
,
server_tid
,
cache_tid
,
protocol
)
elif
cache_tid
==
server_tid
:
self
.
verify_result
=
"Cache up to date"
self
.
finished_verify
(
server_tid
)
else
:
@
protocol
.
promise
(
'getInvalidations'
,
cache_tid
)
def
verify_invalidations
(
vdata
):
if
vdata
:
self
.
verify_result
=
"quick verification"
tid
,
oids
=
vdata
for
oid
in
oids
:
cache
.
invalidate
(
oid
,
None
)
...
...
@@ -485,6 +490,7 @@ class Client:
return
tid
else
:
# cache is too old
self
.
verify_result
=
"cache too old, clearing"
try
:
ZODB
.
event
.
notify
(
ZEO
.
interfaces
.
StaleCache
(
self
.
client
))
...
...
@@ -503,6 +509,7 @@ class Client:
self
.
connected
.
set_exception
,
)
else
:
self
.
verify_result
=
"empty cache"
self
.
finished_verify
(
server_tid
)
@
finish_verify
.
catch
...
...
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