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
f3bdbd04
Commit
f3bdbd04
authored
Jan 21, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure the child process doesn't raise an exception and continue
running the rest of the tests in the child.
parent
a75cce21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
32 deletions
+36
-32
src/ZEO/tests/multi.py
src/ZEO/tests/multi.py
+12
-10
src/ZEO/tests/stress.py
src/ZEO/tests/stress.py
+24
-22
No files found.
src/ZEO/tests/multi.py
View file @
f3bdbd04
...
@@ -56,16 +56,18 @@ def start_server(addr):
...
@@ -56,16 +56,18 @@ def start_server(addr):
def
start_client
(
addr
,
client_func
=
None
):
def
start_client
(
addr
,
client_func
=
None
):
pid
=
os
.
fork
()
pid
=
os
.
fork
()
if
pid
==
0
:
if
pid
==
0
:
import
ZEO.ClientStorage
try
:
if
VERBOSE
:
import
ZEO.ClientStorage
print
"Client process started:"
,
os
.
getpid
()
if
VERBOSE
:
cli
=
ZEO
.
ClientStorage
.
ClientStorage
(
addr
,
client
=
CLIENT_CACHE
)
print
"Client process started:"
,
os
.
getpid
()
if
client_func
is
None
:
cli
=
ZEO
.
ClientStorage
.
ClientStorage
(
addr
,
client
=
CLIENT_CACHE
)
run
(
cli
)
if
client_func
is
None
:
else
:
run
(
cli
)
client_func
(
cli
)
else
:
cli
.
close
()
client_func
(
cli
)
os
.
_exit
(
0
)
cli
.
close
()
finally
:
os
.
_exit
(
0
)
else
:
else
:
return
pid
return
pid
...
...
src/ZEO/tests/stress.py
View file @
f3bdbd04
...
@@ -91,32 +91,34 @@ def start_child(zaddr):
...
@@ -91,32 +91,34 @@ def start_child(zaddr):
if
pid
!=
0
:
if
pid
!=
0
:
return
pid
return
pid
storage
=
ClientStorage
(
zaddr
,
debug
=
1
,
min_disconnect_poll
=
0.5
)
try
:
db
=
ZODB
.
DB
(
storage
,
pool_size
=
NUM_CONNECTIONS
)
storage
=
ClientStorage
(
zaddr
,
debug
=
1
,
min_disconnect_poll
=
0.5
)
setup
(
db
.
open
())
db
=
ZODB
.
DB
(
storage
,
pool_size
=
NUM_CONNECTIONS
)
conns
=
[]
setup
(
db
.
open
())
conn_count
=
0
conns
=
[]
conn_count
=
0
for
i
in
range
(
NUM_CONNECTIONS
):
c
=
db
.
open
()
for
i
in
range
(
NUM_CONNECTIONS
):
c
.
__count
=
0
conns
.
append
(
c
)
conn_count
+=
1
while
conn_count
<
25
:
c
=
random
.
choice
(
conns
)
if
c
.
__count
>
NUM_TRANSACTIONS_PER_CONN
:
conns
.
remove
(
c
)
c
.
close
()
conn_count
+=
1
c
=
db
.
open
()
c
=
db
.
open
()
c
.
__count
=
0
c
.
__count
=
0
conns
.
append
(
c
)
conns
.
append
(
c
)
else
:
conn_count
+=
1
c
.
__count
+=
1
work
(
c
)
os
.
_exit
(
0
)
while
conn_count
<
25
:
c
=
random
.
choice
(
conns
)
if
c
.
__count
>
NUM_TRANSACTIONS_PER_CONN
:
conns
.
remove
(
c
)
c
.
close
()
conn_count
+=
1
c
=
db
.
open
()
c
.
__count
=
0
conns
.
append
(
c
)
else
:
c
.
__count
+=
1
work
(
c
)
finally
:
os
.
_exit
(
0
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
main
()
main
()
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