Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Zope
Commits
f6e0c9e9
Commit
f6e0c9e9
authored
Apr 09, 2007
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged trunk r73189:73190 into 2.9 branch.
Protect against setNumberOfThreads disappearing after first use.
parent
de614302
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
lib/python/Testing/ZopeTestCase/threadutils.py
lib/python/Testing/ZopeTestCase/threadutils.py
+9
-0
lib/python/Testing/ZopeTestCase/utils.py
lib/python/Testing/ZopeTestCase/utils.py
+1
-1
No files found.
lib/python/Testing/ZopeTestCase/threadutils.py
View file @
f6e0c9e9
...
...
@@ -22,6 +22,15 @@ from StringIO import StringIO
dummyLOG
=
StringIO
()
def
setNumberOfThreads
(
number_of_threads
):
'''Sets number of ZServer threads.'''
try
:
from
ZServer.PubCore
import
setNumberOfThreads
setNumberOfThreads
(
number_of_threads
)
except
ImportError
:
pass
def
zserverRunner
(
host
,
port
,
log
=
None
):
'''Runs an HTTP ZServer on host:port.'''
from
ZServer
import
logger
,
asyncore
...
...
lib/python/Testing/ZopeTestCase/utils.py
View file @
f6e0c9e9
...
...
@@ -115,7 +115,7 @@ def startZServer(number_of_threads=1, log=None):
if
_Z2HOST
is
None
:
_Z2HOST
=
'127.0.0.1'
_Z2PORT
=
random
.
choice
(
range
(
55000
,
55500
))
from
ZServer
import
setNumberOfThreads
from
threadutils
import
setNumberOfThreads
setNumberOfThreads
(
number_of_threads
)
from
threadutils
import
QuietThread
,
zserverRunner
t
=
QuietThread
(
target
=
zserverRunner
,
args
=
(
_Z2HOST
,
_Z2PORT
,
log
))
...
...
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