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
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
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
Show 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:
...
@@ -454,6 +454,7 @@ class Client:
self
.
register_failed_poll
+
local_random
.
random
(),
self
.
register_failed_poll
+
local_random
.
random
(),
self
.
try_connecting
)
self
.
try_connecting
)
verify_result
=
None
# for tests
def
verify
(
self
,
last_transaction_promise
):
def
verify
(
self
,
last_transaction_promise
):
protocol
=
self
.
protocol
protocol
=
self
.
protocol
...
@@ -463,21 +464,25 @@ class Client:
...
@@ -463,21 +464,25 @@ class Client:
if
cache
:
if
cache
:
cache_tid
=
cache
.
getLastTid
()
cache_tid
=
cache
.
getLastTid
()
if
not
cache_tid
:
if
not
cache_tid
:
self
.
verify_result
=
"Non-empty cache w/o tid"
logger
.
error
(
"Non-empty cache w/o tid -- clearing"
)
logger
.
error
(
"Non-empty cache w/o tid -- clearing"
)
cache
.
clear
()
cache
.
clear
()
self
.
client
.
invalidateCache
()
self
.
client
.
invalidateCache
()
self
.
finished_verify
(
server_tid
)
self
.
finished_verify
(
server_tid
)
elif
cache_tid
>
server_tid
:
elif
cache_tid
>
server_tid
:
self
.
verify_result
=
"Cache newer than server"
logger
.
critical
(
logger
.
critical
(
'Client has seen newer transactions than server!'
)
'Client has seen newer transactions than server!'
)
raise
AssertionError
(
"Server behind client, %r < %r, %s"
,
raise
AssertionError
(
"Server behind client, %r < %r, %s"
,
server_tid
,
cache_tid
,
protocol
)
server_tid
,
cache_tid
,
protocol
)
elif
cache_tid
==
server_tid
:
elif
cache_tid
==
server_tid
:
self
.
verify_result
=
"Cache up to date"
self
.
finished_verify
(
server_tid
)
self
.
finished_verify
(
server_tid
)
else
:
else
:
@
protocol
.
promise
(
'getInvalidations'
,
cache_tid
)
@
protocol
.
promise
(
'getInvalidations'
,
cache_tid
)
def
verify_invalidations
(
vdata
):
def
verify_invalidations
(
vdata
):
if
vdata
:
if
vdata
:
self
.
verify_result
=
"quick verification"
tid
,
oids
=
vdata
tid
,
oids
=
vdata
for
oid
in
oids
:
for
oid
in
oids
:
cache
.
invalidate
(
oid
,
None
)
cache
.
invalidate
(
oid
,
None
)
...
@@ -485,6 +490,7 @@ class Client:
...
@@ -485,6 +490,7 @@ class Client:
return
tid
return
tid
else
:
else
:
# cache is too old
# cache is too old
self
.
verify_result
=
"cache too old, clearing"
try
:
try
:
ZODB
.
event
.
notify
(
ZODB
.
event
.
notify
(
ZEO
.
interfaces
.
StaleCache
(
self
.
client
))
ZEO
.
interfaces
.
StaleCache
(
self
.
client
))
...
@@ -503,6 +509,7 @@ class Client:
...
@@ -503,6 +509,7 @@ class Client:
self
.
connected
.
set_exception
,
self
.
connected
.
set_exception
,
)
)
else
:
else
:
self
.
verify_result
=
"empty cache"
self
.
finished_verify
(
server_tid
)
self
.
finished_verify
(
server_tid
)
@
finish_verify
.
catch
@
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