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
a4eca036
Commit
a4eca036
authored
May 26, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed more tests
parent
c536ed31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
30 deletions
+11
-30
src/ZEO/tests/ConnectionTests.py
src/ZEO/tests/ConnectionTests.py
+11
-30
No files found.
src/ZEO/tests/ConnectionTests.py
View file @
a4eca036
...
@@ -45,23 +45,10 @@ class TestClientStorage(ClientStorage):
...
@@ -45,23 +45,10 @@ class TestClientStorage(ClientStorage):
connection_count_for_tests
=
0
connection_count_for_tests
=
0
def
notify
Connected
(
self
,
conn
):
def
notify
_connected
(
self
,
conn
,
info
):
ClientStorage
.
notify
Connected
(
self
,
conn
)
ClientStorage
.
notify
_connected
(
self
,
conn
,
info
)
self
.
connection_count_for_tests
+=
1
self
.
connection_count_for_tests
+=
1
self
.
verify_result
=
conn
.
verify_result
def
verify_cache
(
self
,
stub
):
self
.
end_verify
=
threading
.
Event
()
self
.
verify_result
=
ClientStorage
.
verify_cache
(
self
,
stub
)
def
endVerify
(
self
):
ClientStorage
.
endVerify
(
self
)
self
.
end_verify
.
set
()
def
testConnection
(
self
,
conn
):
try
:
return
ClientStorage
.
testConnection
(
self
,
conn
)
finally
:
self
.
test_connection
=
True
class
DummyDB
:
class
DummyDB
:
def
invalidate
(
self
,
*
args
,
**
kwargs
):
def
invalidate
(
self
,
*
args
,
**
kwargs
):
...
@@ -658,13 +645,7 @@ class InvqTests(CommonSetupTearDown):
...
@@ -658,13 +645,7 @@ class InvqTests(CommonSetupTearDown):
revid
=
self
.
_dostore
(
oid
,
revid
)
revid
=
self
.
_dostore
(
oid
,
revid
)
perstorage
=
self
.
openClientStorage
(
cache
=
"test"
)
perstorage
=
self
.
openClientStorage
(
cache
=
"test"
)
self
.
assertEqual
(
perstorage
.
verify_result
,
"full verification"
)
self
.
assertEqual
(
perstorage
.
verify_result
,
"cache too old, clearing"
)
t
=
time
.
time
()
+
30
while
not
perstorage
.
end_verify
.
isSet
():
perstorage
.
sync
()
if
time
.
time
()
>
t
:
self
.
fail
(
"timed out waiting for endVerify"
)
self
.
assertEqual
(
self
.
_storage
.
load
(
oid
,
''
)[
1
],
revid
)
self
.
assertEqual
(
self
.
_storage
.
load
(
oid
,
''
)[
1
],
revid
)
self
.
assertEqual
(
perstorage
.
load
(
oid
,
''
),
self
.
assertEqual
(
perstorage
.
load
(
oid
,
''
),
self
.
_storage
.
load
(
oid
,
''
))
self
.
_storage
.
load
(
oid
,
''
))
...
@@ -800,8 +781,9 @@ class ReconnectionTests(CommonSetupTearDown):
...
@@ -800,8 +781,9 @@ class ReconnectionTests(CommonSetupTearDown):
self
.
_servers
=
[]
self
.
_servers
=
[]
# Poll until the client disconnects
# Poll until the client disconnects
self
.
pollDown
()
self
.
pollDown
()
# Stores should fail now
self
.
assertRaises
(
ClientDisconnected
,
self
.
_dostore
)
# Accesses should fail now
self
.
assertRaises
(
ClientDisconnected
,
self
.
_storage
.
history
,
ZERO
)
# Restart the server, this time read-write
# Restart the server, this time read-write
self
.
startServer
(
create
=
0
,
keep
=
0
)
self
.
startServer
(
create
=
0
,
keep
=
0
)
...
@@ -855,7 +837,7 @@ class ReconnectionTests(CommonSetupTearDown):
...
@@ -855,7 +837,7 @@ class ReconnectionTests(CommonSetupTearDown):
self
.
pollUp
()
self
.
pollUp
()
# There were no transactions committed, so no verification
# There were no transactions committed, so no verification
# should be needed.
# should be needed.
self
.
assertEqual
(
self
.
_storage
.
verify_result
,
"
no verification
"
)
self
.
assertEqual
(
self
.
_storage
.
verify_result
,
"
Cache up to date
"
)
def
checkNoVerificationOnServerRestartWith2Clients
(
self
):
def
checkNoVerificationOnServerRestartWith2Clients
(
self
):
perstorage
=
self
.
openClientStorage
(
cache
=
"test"
)
perstorage
=
self
.
openClientStorage
(
cache
=
"test"
)
...
@@ -886,8 +868,8 @@ class ReconnectionTests(CommonSetupTearDown):
...
@@ -886,8 +868,8 @@ class ReconnectionTests(CommonSetupTearDown):
self
.
pollUp
(
storage
=
perstorage
)
self
.
pollUp
(
storage
=
perstorage
)
# There were no transactions committed, so no verification
# There were no transactions committed, so no verification
# should be needed.
# should be needed.
self
.
assertEqual
(
self
.
_storage
.
verify_result
,
"
no verification
"
)
self
.
assertEqual
(
self
.
_storage
.
verify_result
,
"
Cache up to date
"
)
self
.
assertEqual
(
perstorage
.
verify_result
,
"
no verification
"
)
self
.
assertEqual
(
perstorage
.
verify_result
,
"
Cache up to date
"
)
perstorage
.
close
()
perstorage
.
close
()
self
.
_storage
.
close
()
self
.
_storage
.
close
()
...
@@ -902,9 +884,8 @@ class ReconnectionTests(CommonSetupTearDown):
...
@@ -902,9 +884,8 @@ class ReconnectionTests(CommonSetupTearDown):
self
.
_storage
.
store
(
oid
,
None
,
data
,
''
,
txn
)
self
.
_storage
.
store
(
oid
,
None
,
data
,
''
,
txn
)
self
.
shutdownServer
()
self
.
shutdownServer
()
self
.
assertRaises
(
ClientDisconnected
,
self
.
_storage
.
tpc_vote
,
txn
)
self
.
assertRaises
(
ClientDisconnected
,
self
.
_storage
.
tpc_vote
,
txn
)
self
.
_storage
.
tpc_abort
(
txn
)
self
.
startServer
(
create
=
0
)
self
.
startServer
(
create
=
0
)
self
.
_storage
.
_wait
(
)
self
.
_storage
.
tpc_abort
(
txn
)
self
.
_dostore
()
self
.
_dostore
()
# This test is supposed to cover the following error, although
# This test is supposed to cover the following error, although
...
...
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