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
e7a6a4b7
Commit
e7a6a4b7
authored
Jun 05, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an onfail argument to wait_until to provide alternate behavior
for a timeout.
parent
100a2556
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/ZEO/tests/forker.py
src/ZEO/tests/forker.py
+9
-8
No files found.
src/ZEO/tests/forker.py
View file @
e7a6a4b7
...
@@ -330,13 +330,14 @@ def setUp(test):
...
@@ -330,13 +330,14 @@ def setUp(test):
test
.
globs
[
'wait_disconnected'
]
=
wait_disconnected
test
.
globs
[
'wait_disconnected'
]
=
wait_disconnected
def
wait_until
(
label
,
func
,
timeout
=
30
):
def
wait_until
(
label
,
func
,
timeout
=
30
,
onfail
=
None
):
now
=
time
.
time
()
giveup
=
time
.
time
()
+
timeout
giveup
=
now
+
30
while
not
func
():
while
not
func
():
now
=
time
.
time
()
if
time
.
time
()
>
giveup
:
if
time
.
time
()
>
giveup
:
if
onfail
is
None
:
raise
AssertionError
(
"Timed out waiting for: "
,
label
)
raise
AssertionError
(
"Timed out waiting for: "
,
label
)
else
:
return
onfail
()
time
.
sleep
(
0.01
)
time
.
sleep
(
0.01
)
def
wait_connected
(
storage
):
def
wait_connected
(
storage
):
...
...
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