Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
e370399a
Commit
e370399a
authored
Jan 02, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored a test helper to make it a little more self documenting.
parent
156107a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
src/ZEO/tests/ConnectionTests.py
src/ZEO/tests/ConnectionTests.py
+2
-0
src/ZEO/tests/forker.py
src/ZEO/tests/forker.py
+6
-8
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+3
-1
No files found.
src/ZEO/tests/ConnectionTests.py
View file @
e370399a
...
...
@@ -640,6 +640,7 @@ class InvqTests(CommonSetupTearDown):
revid
=
self
.
_dostore
(
oid
)
revid
=
self
.
_dostore
(
oid
,
revid
)
forker
.
wait_until
(
"Client has seen all of the transactions from the server"
,
lambda
:
perstorage
.
lastTransaction
()
==
self
.
_storage
.
lastTransaction
()
)
...
...
@@ -864,6 +865,7 @@ class ReconnectionTests(CommonSetupTearDown):
revid
=
self
.
_dostore
(
oid
)
revid
=
self
.
_dostore
(
oid
,
revid
)
forker
.
wait_until
(
"Client has seen all of the transactions from the server"
,
lambda
:
perstorage
.
lastTransaction
()
==
self
.
_storage
.
lastTransaction
()
)
...
...
src/ZEO/tests/forker.py
View file @
e370399a
...
...
@@ -330,20 +330,18 @@ def setUp(test):
test
.
globs
[
'wait_disconnected'
]
=
wait_disconnected
def
wait_until
(
func
,
timeout
=
30
,
label
=
None
):
if
not
label
:
label
=
func
.
__name__
def
wait_until
(
label
,
func
,
timeout
=
30
):
now
=
time
.
time
()
giveup
=
now
+
30
while
not
func
():
now
=
time
.
time
()
if
time
.
time
()
>
giveup
:
raise
AssertionError
(
"Timed out waiting for"
,
label
)
raise
AssertionError
(
"Timed out waiting for
:
"
,
label
)
time
.
sleep
(
0.01
)
def
wait_connected
(
storage
):
wait_until
(
storage
.
is_connected
)
wait_until
(
"storage is connected"
,
storage
.
is_connected
)
def
wait_disconnected
(
storage
):
def
not_connected
():
return
not
storage
.
is_connected
(
)
wait_until
(
"storage is disconnected"
,
lambda
:
not
storage
.
is_connected
()
)
src/ZEO/tests/testZEO.py
View file @
e370399a
...
...
@@ -1139,7 +1139,9 @@ def delete_object_multiple_clients():
try to access the object. We'll get a POSKeyError there too:
>>> tid = db.storage.lastTransaction()
>>> forker.wait_until(lambda : cs.lastTransaction() == tid)
>>> forker.wait_until(
... 'cs has caught up',
... lambda : cs.lastTransaction() == tid)
>>> cs.load(oid) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
...
...
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