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
c8d92a1c
Commit
c8d92a1c
authored
Mar 15, 2007
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect against setNumberOfThreads disappearing after first use...
parent
ae60ba1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
lib/python/Testing/ZopeTestCase/threadutils.py
lib/python/Testing/ZopeTestCase/threadutils.py
+10
-1
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 @
c8d92a1c
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
"""Parts of ZServer support are in this module so they can
"""Parts of ZServer support are in this module so they can
be imported more selectively.
be imported more selectively.
$Id
: threadutils.py,v 1.6 2004/08/19 15:31:26 shh42 Exp
$
$Id$
"""
"""
from
threading
import
Thread
from
threading
import
Thread
...
@@ -22,6 +22,15 @@ from StringIO import StringIO
...
@@ -22,6 +22,15 @@ from StringIO import StringIO
dummyLOG
=
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
):
def
zserverRunner
(
host
,
port
,
log
=
None
):
'''Runs an HTTP ZServer on host:port.'''
'''Runs an HTTP ZServer on host:port.'''
from
ZServer
import
logger
,
asyncore
from
ZServer
import
logger
,
asyncore
...
...
lib/python/Testing/ZopeTestCase/utils.py
View file @
c8d92a1c
...
@@ -115,7 +115,7 @@ def startZServer(number_of_threads=1, log=None):
...
@@ -115,7 +115,7 @@ def startZServer(number_of_threads=1, log=None):
if
_Z2HOST
is
None
:
if
_Z2HOST
is
None
:
_Z2HOST
=
'127.0.0.1'
_Z2HOST
=
'127.0.0.1'
_Z2PORT
=
random
.
choice
(
range
(
55000
,
55500
))
_Z2PORT
=
random
.
choice
(
range
(
55000
,
55500
))
from
ZServer
import
setNumberOfThreads
from
threadutils
import
setNumberOfThreads
setNumberOfThreads
(
number_of_threads
)
setNumberOfThreads
(
number_of_threads
)
from
threadutils
import
QuietThread
,
zserverRunner
from
threadutils
import
QuietThread
,
zserverRunner
t
=
QuietThread
(
target
=
zserverRunner
,
args
=
(
_Z2HOST
,
_Z2PORT
,
log
))
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